Module: OpenAI::Models::Beta::BetaTool::Mcp::AllowedCaller

Extended by:
Internal::Type::Enum
Defined in:
lib/openai/models/beta/beta_tool.rb

Constant Summary collapse

DIRECT =
:direct
PROGRAMMATIC =
:programmatic

Instance Method Summary collapse

Methods included from Internal::Type::Enum

==, ===, coerce, dump, hash, inspect, to_sorbet_type, values, values

Methods included from Internal::Util::SorbetRuntimeSupport

#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type

Methods included from Internal::Type::Converter

#coerce, coerce, coerce_with_error, dump, #dump, #inspect, inspect, meta_info, new_coerce_state, type_info

Instance Method Details

#initialize(server_label:, allowed_callers: nil, allowed_tools: nil, authorization: nil, connector_id: nil, defer_loading: nil, headers: nil, require_approval: nil, server_description: nil, server_url: nil, tunnel_id: nil, type: :mcp) ⇒ Object

Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.

Parameters:

  • server_label (String)

    A label for this MCP server, used to identify it in tool calls.

  • allowed_callers (Array<Symbol, OpenAI::Models::Beta::BetaTool::Mcp::AllowedCaller>, nil) (defaults to: nil)

    The tool invocation context(s).

  • allowed_tools (Array<String>, OpenAI::Models::Beta::BetaTool::Mcp::AllowedTools::McpToolFilter, nil) (defaults to: nil)

    List of allowed tool names or a filter object.

  • authorization (String) (defaults to: nil)

    An OAuth access token that can be used with a remote MCP server, either with a custom MCP server URL or a service connector. Your application must handle the OAuth authorization flow and provide the token here.

  • connector_id (Symbol, OpenAI::Models::Beta::BetaTool::Mcp::ConnectorID) (defaults to: nil)

    Identifier for service connectors, like those available in ChatGPT. One of server_url, connector_id, or tunnel_id must be provided. Learn more about service connectors here.

    This field is deprecated for models released after September 1, 2026. Use server_url to connect to a remote MCP server, or tunnel_id to connect through a Secure MCP Tunnel.

    Currently supported connector_id values are:

    • Dropbox: connector_dropbox
    • Gmail: connector_gmail
    • Google Calendar: connector_googlecalendar
    • Google Drive: connector_googledrive
    • Microsoft Teams: connector_microsoftteams
    • Outlook Calendar: connector_outlookcalendar
    • Outlook Email: connector_outlookemail
    • SharePoint: connector_sharepoint
  • defer_loading (Boolean) (defaults to: nil)

    Whether this MCP tool is deferred and discovered via tool search.

  • headers (Hash{Symbol=>String}, nil) (defaults to: nil)

    Optional HTTP headers to send to the MCP server. Use for authentication or other purposes.

  • require_approval (OpenAI::Models::Beta::BetaTool::Mcp::RequireApproval::McpToolApprovalFilter, Symbol, OpenAI::Models::Beta::BetaTool::Mcp::RequireApproval::McpToolApprovalSetting, nil) (defaults to: nil)

    Specify which of the MCP server's tools require approval.

  • server_description (String) (defaults to: nil)

    Optional description of the MCP server, used to provide more context.

  • server_url (String) (defaults to: nil)

    The URL for the MCP server. One of server_url, connector_id, or tunnel_id must be provided.

  • tunnel_id (String) (defaults to: nil)

    The Secure MCP Tunnel ID to use instead of a direct server URL. One of server_url, connector_id, or tunnel_id must be provided.

  • type (Symbol, :mcp) (defaults to: :mcp)

    The type of the MCP tool. Always mcp.



226
227
228
229
230
231
232
233
234
# File 'lib/openai/models/beta/beta_tool.rb', line 226

module AllowedCaller
  extend OpenAI::Internal::Type::Enum

  DIRECT = :direct
  PROGRAMMATIC = :programmatic

  # @!method self.values
  #   @return [Array<Symbol>]
end