Class: OpenAI::Models::Realtime::RealtimeToolsConfigUnion::Mcp

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/openai/models/realtime/realtime_tools_config_union.rb,
sig/openai/models/realtime/realtime_tools_config_union.rbs

Defined Under Namespace

Modules: AllowedCaller, AllowedTools, ConnectorID, RequireApproval

Instance Attribute Summary collapse

Attributes inherited from Internal::Type::BaseModel

#last_response

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Internal::Type::BaseModel

==, #==, #[], #_request_id, #_set_last_response, coerce, #deconstruct_keys, #deep_to_h, dump, #encode_with, fields, hash, #hash, inherited, #inspect, inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml

Methods included from Internal::Type::Converter

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

Methods included from Internal::Util::SorbetRuntimeSupport

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

Constructor Details

#initialize ⇒ Object

Parameters:

  • server_label —

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

  • allowed_callers —

    The tool invocation context(s).

  • allowed_tools —

    List of allowed tool names or a filter object.

  • authorization —

    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 —

    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 —

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

  • headers —

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

  • require_approval —

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

  • server_description —

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

  • server_url —

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

  • tunnel_id —

    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 —

    The type of the MCP tool. Always mcp.



176
# File 'sig/openai/models/realtime/realtime_tools_config_union.rbs', line 176

def initialize: (

Instance Attribute Details

#allowed_callers ⇒ ::Array[OpenAI::Models::Realtime::RealtimeToolsConfigUnion::Mcp::allowed_caller]?

The tool invocation context(s).

Returns:

  • (::Array[OpenAI::Models::Realtime::RealtimeToolsConfigUnion::Mcp::allowed_caller], nil)


37
38
39
40
41
42
43
# File 'lib/openai/models/realtime/realtime_tools_config_union.rb', line 37

optional(
  :allowed_callers,
  -> {
    OpenAI::Internal::Type::ArrayOf[enum: OpenAI::Realtime::RealtimeToolsConfigUnion::Mcp::AllowedCaller]
  },
  nil?: true
)

#allowed_tools ⇒ OpenAI::Models::Realtime::RealtimeToolsConfigUnion::Mcp::allowed_tools?

List of allowed tool names or a filter object.

Returns:

  • (OpenAI::Models::Realtime::RealtimeToolsConfigUnion::Mcp::allowed_tools, nil)


49
50
51
52
53
# File 'lib/openai/models/realtime/realtime_tools_config_union.rb', line 49

optional(
  :allowed_tools,
  union: -> { OpenAI::Realtime::RealtimeToolsConfigUnion::Mcp::AllowedTools },
  nil?: true
)

#authorization ⇒ String?

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.

Returns:

  • (String, nil)


61
# File 'lib/openai/models/realtime/realtime_tools_config_union.rb', line 61

optional :authorization, String

#connector_id ⇒ OpenAI::Models::Realtime::RealtimeToolsConfigUnion::Mcp::connector_id?

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

Returns:

  • (OpenAI::Models::Realtime::RealtimeToolsConfigUnion::Mcp::connector_id, nil)


87
# File 'lib/openai/models/realtime/realtime_tools_config_union.rb', line 87

optional :connector_id, enum: -> { OpenAI::Realtime::RealtimeToolsConfigUnion::Mcp::ConnectorID }

#defer_loading ⇒ Boolean?

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

Returns:



93
# File 'lib/openai/models/realtime/realtime_tools_config_union.rb', line 93

optional :defer_loading, OpenAI::Internal::Type::Boolean

#headers ⇒ ::Hash[Symbol, String]?

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

Returns:

  • (::Hash[Symbol, String], nil)


100
# File 'lib/openai/models/realtime/realtime_tools_config_union.rb', line 100

optional :headers, OpenAI::Internal::Type::HashOf[String], nil?: true

#require_approval ⇒ OpenAI::Models::Realtime::RealtimeToolsConfigUnion::Mcp::require_approval?

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

Returns:

  • (OpenAI::Models::Realtime::RealtimeToolsConfigUnion::Mcp::require_approval, nil)


106
107
108
109
110
# File 'lib/openai/models/realtime/realtime_tools_config_union.rb', line 106

optional(
  :require_approval,
  union: -> { OpenAI::Realtime::RealtimeToolsConfigUnion::Mcp::RequireApproval },
  nil?: true
)

#server_description ⇒ String?

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

Returns:

  • (String, nil)


116
# File 'lib/openai/models/realtime/realtime_tools_config_union.rb', line 116

optional :server_description, String

#server_label ⇒ String

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

Returns:

  • (String)


25
# File 'lib/openai/models/realtime/realtime_tools_config_union.rb', line 25

required :server_label, String

#server_url ⇒ String?

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

Returns:

  • (String, nil)


123
# File 'lib/openai/models/realtime/realtime_tools_config_union.rb', line 123

optional :server_url, String

#tunnel_id ⇒ String?

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.

Returns:

  • (String, nil)


130
# File 'lib/openai/models/realtime/realtime_tools_config_union.rb', line 130

optional :tunnel_id, String

#type ⇒ :mcp

The type of the MCP tool. Always mcp.

Returns:

  • (:mcp)


31
# File 'lib/openai/models/realtime/realtime_tools_config_union.rb', line 31

required :type, const: :mcp

Class Method Details

.values ⇒ Array<Symbol>

Returns:

  • (Array<Symbol>)


# File 'lib/openai/models/realtime/realtime_tools_config_union.rb', line 201

Instance Method Details

#to_hash ⇒ {

Returns:

  • ({)


191
# File 'sig/openai/models/realtime/realtime_tools_config_union.rbs', line 191

def to_hash: -> {