Class: OpenAI::Models::Beta::PersistedAgentToolParam::Mcp

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

Tools provided by a remote MCP server without stored credentials.

Parameters:

  • server_label (String)

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

  • transport (OpenAI::Models::Beta::PersistedMcpTransportParam::HTTP, OpenAI::Models::Beta::PersistedMcpTransportParam::Stdio)

    The credential-free transport used to connect to the MCP server.

  • allowed_tools (Array<String>, nil) (defaults to: nil)

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

  • connection_origin (Symbol, OpenAI::Models::Beta::PersistedAgentToolParam::Mcp::ConnectionOrigin, nil) (defaults to: nil)

    Where outbound MCP HTTP connections originate.

  • credential_id (String, nil) (defaults to: nil)

    The vault credential selected for this MCP server. Optional when exactly one attached credential matches the server URL.

  • request_metadata (Hash{Symbol=>Object}, nil) (defaults to: nil)

    Metadata included with requests to this MCP server.

  • required (Boolean) (defaults to: nil)

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

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

    The type of the object. Always mcp.



# File 'lib/openai/models/beta/persisted_agent_tool_param.rb', line 175

Instance Attribute Details

#allowed_toolsArray<String>?

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

Parameters:

  • value (::Array[String], nil)

Returns:

  • (Array<String>, nil)


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

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

#connection_originSymbol, ...

Where outbound MCP HTTP connections originate.

Parameters:

  • value (OpenAI::Models::Beta::PersistedAgentToolParam::Mcp::connection_origin, nil)

Returns:



145
146
147
148
149
# File 'lib/openai/models/beta/persisted_agent_tool_param.rb', line 145

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

#credential_idString?

The vault credential selected for this MCP server. Optional when exactly one attached credential matches the server URL.

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


156
# File 'lib/openai/models/beta/persisted_agent_tool_param.rb', line 156

optional :credential_id, String, nil?: true

#request_metadataHash{Symbol=>Object}?

Metadata included with requests to this MCP server.

Parameters:

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

Returns:

  • (Hash{Symbol=>Object}, nil)


162
163
164
165
166
# File 'lib/openai/models/beta/persisted_agent_tool_param.rb', line 162

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.

Parameters:

Returns:



173
# File 'lib/openai/models/beta/persisted_agent_tool_param.rb', line 173

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

#server_labelString

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

Parameters:

  • value (String)

Returns:

  • (String)


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

required :server_label, String

#transportOpenAI::Models::Beta::PersistedMcpTransportParam::HTTP, OpenAI::Models::Beta::PersistedMcpTransportParam::Stdio

The credential-free transport used to connect to the MCP server.

Parameters:

  • value (OpenAI::Models::Beta::persisted_mcp_transport_param)

Returns:



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

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

#typeSymbol, :mcp

The type of the object. Always mcp.

Parameters:

  • value (:mcp)

Returns:

  • (Symbol, :mcp)


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

required :type, const: :mcp

Instance Method Details

#to_hash{

Returns:

  • ({)


123
# File 'sig/openai/models/beta/persisted_agent_tool_param.rbs', line 123

def to_hash: -> {