Class: OpenAI::Models::Realtime::RealtimeResponseCreateMcpTool

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/openai/models/realtime/realtime_response_create_mcp_tool.rb,
sig/openai/models/realtime/realtime_response_create_mcp_tool.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.



169
# File 'sig/openai/models/realtime/realtime_response_create_mcp_tool.rbs', line 169

def initialize: (

Instance Attribute Details

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

The tool invocation context(s).

Returns:

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


23
24
25
26
27
28
29
# File 'lib/openai/models/realtime/realtime_response_create_mcp_tool.rb', line 23

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

#allowed_tools ⇒ OpenAI::Models::Realtime::RealtimeResponseCreateMcpTool::allowed_tools?

List of allowed tool names or a filter object.

Returns:

  • (OpenAI::Models::Realtime::RealtimeResponseCreateMcpTool::allowed_tools, nil)


35
36
37
38
39
# File 'lib/openai/models/realtime/realtime_response_create_mcp_tool.rb', line 35

optional(
  :allowed_tools,
  union: -> { OpenAI::Realtime::RealtimeResponseCreateMcpTool::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)


47
# File 'lib/openai/models/realtime/realtime_response_create_mcp_tool.rb', line 47

optional :authorization, String

#connector_id ⇒ OpenAI::Models::Realtime::RealtimeResponseCreateMcpTool::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::RealtimeResponseCreateMcpTool::connector_id, nil)


73
# File 'lib/openai/models/realtime/realtime_response_create_mcp_tool.rb', line 73

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

#defer_loading ⇒ Boolean?

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

Returns:



79
# File 'lib/openai/models/realtime/realtime_response_create_mcp_tool.rb', line 79

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)


86
# File 'lib/openai/models/realtime/realtime_response_create_mcp_tool.rb', line 86

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

#require_approval ⇒ OpenAI::Models::Realtime::RealtimeResponseCreateMcpTool::require_approval?

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

Returns:

  • (OpenAI::Models::Realtime::RealtimeResponseCreateMcpTool::require_approval, nil)


92
93
94
95
96
# File 'lib/openai/models/realtime/realtime_response_create_mcp_tool.rb', line 92

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

#server_description ⇒ String?

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

Returns:

  • (String, nil)


102
# File 'lib/openai/models/realtime/realtime_response_create_mcp_tool.rb', line 102

optional :server_description, String

#server_label ⇒ String

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

Returns:

  • (String)


11
# File 'lib/openai/models/realtime/realtime_response_create_mcp_tool.rb', line 11

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)


109
# File 'lib/openai/models/realtime/realtime_response_create_mcp_tool.rb', line 109

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)


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

optional :tunnel_id, String

#type ⇒ :mcp

The type of the MCP tool. Always mcp.

Returns:

  • (:mcp)


17
# File 'lib/openai/models/realtime/realtime_response_create_mcp_tool.rb', line 17

required :type, const: :mcp

Class Method Details

.values ⇒ Array<Symbol>

Returns:

  • (Array<Symbol>)


# File 'lib/openai/models/realtime/realtime_response_create_mcp_tool.rb', line 187

Instance Method Details

#to_hash ⇒ {

Returns:

  • ({)


184
# File 'sig/openai/models/realtime/realtime_response_create_mcp_tool.rbs', line 184

def to_hash: -> {