Class: OpenAI::Models::Beta::AgentToolParam::Mcp

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

Defined Under Namespace

Modules: ConnectionOrigin

Instance Attribute Summary collapse

Attributes inherited from Internal::Type::BaseModel

#last_response

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(server_label:, transport:, allowed_tools: nil, connection_origin: nil, credential_id: nil, request_metadata: nil, required: nil, type: :mcp) ⇒ Object

Parameters:

  • server_label

    A label used to identify the MCP server in tool calls.

  • transport

    The transport used to connect to the MCP server.

  • allowed_tools (defaults to: nil)

    The MCP tools the agent may call. All server tools are allowed when omitted.

  • connection_origin (defaults to: nil)

    Selects where outbound MCP HTTP connections originate. Omitted or service uses the Managed Agents service network; environment uses the session's selected environment.

  • credential_id (defaults to: nil)

    The attached vault credential used to authenticate this MCP server. Optional when exactly one attached credential matches the server URL.

  • request_metadata (defaults to: nil)

    Metadata included with requests to this MCP server.

  • required (defaults to: nil)

    Whether this MCP server must initialize before the first turn. Defaults to false.

  • type (defaults to: :mcp)

    The type of the object. Always mcp.



# File 'lib/openai/models/beta/agent_tool_param.rb', line 179


Instance Attribute Details

#allowed_tools::Array[String]?

The MCP tools the agent may call. All server tools are allowed when omitted.

Returns:

  • (::Array[String], nil)


139
# File 'lib/openai/models/beta/agent_tool_param.rb', line 139

optional :allowed_tools, OpenAI::Internal::Type::ArrayOf[String], nil?: true

#connection_originOpenAI::Models::Beta::AgentToolParam::Mcp::connection_origin?

Selects where outbound MCP HTTP connections originate. Omitted or service uses the Managed Agents service network; environment uses the session's selected environment.

Returns:

  • (OpenAI::Models::Beta::AgentToolParam::Mcp::connection_origin, nil)


147
148
149
150
151
152
153
# File 'lib/openai/models/beta/agent_tool_param.rb', line 147

optional(
  :connection_origin,
  enum: -> {
    OpenAI::Beta::AgentToolParam::Mcp::ConnectionOrigin
  },
  nil?: true
)

#credential_idString?

The attached vault credential used to authenticate this MCP server. Optional when exactly one attached credential matches the server URL.

Returns:

  • (String, nil)


160
# File 'lib/openai/models/beta/agent_tool_param.rb', line 160

optional :credential_id, String, nil?: true

#request_metadata::Hash[Symbol, top]?

Metadata included with requests to this MCP server.

Returns:

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


166
167
168
169
170
# File 'lib/openai/models/beta/agent_tool_param.rb', line 166

optional(
  :request_metadata,
  OpenAI::Internal::Type::HashOf[OpenAI::Internal::Type::Unknown],
  nil?: true
)

#requiredBoolean?

Whether this MCP server must initialize before the first turn. Defaults to false.

Returns:



177
# File 'lib/openai/models/beta/agent_tool_param.rb', line 177

optional :required, OpenAI::Internal::Type::Boolean

#server_labelString

A label used to identify the MCP server in tool calls.

Returns:

  • (String)


121
# File 'lib/openai/models/beta/agent_tool_param.rb', line 121

required :server_label, String

#transportOpenAI::Models::Beta::mcp_transport_param

The transport used to connect to the MCP server.

Returns:

  • (OpenAI::Models::Beta::mcp_transport_param)


127
# File 'lib/openai/models/beta/agent_tool_param.rb', line 127

required :transport, union: -> { OpenAI::Beta::McpTransportParam }

#type:mcp

The type of the object. Always mcp.

Returns:

  • (:mcp)


133
# File 'lib/openai/models/beta/agent_tool_param.rb', line 133

required :type, const: :mcp

Instance Method Details

#to_hash{

Returns:

  • ({)


186
# File 'sig/openai/models/beta/agent_tool_param.rbs', line 186

def to_hash: -> {