Class: OpenAI::Models::Beta::PersistedAgentTool::Mcp

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/openai/models/beta/persisted_agent_tool.rb,
sig/openai/models/beta/persisted_agent_tool.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(allowed_tools:, connection_origin:, credential_id:, request_metadata:, required:, server_label:, transport:, type: :mcp) ⇒ Object

Tools provided by a remote MCP server without stored credentials.

Parameters:

  • allowed_tools (Array<String>, nil)

    The MCP tools the agent may call, or null when all server tools are allowed.

  • connection_origin (Symbol, OpenAI::Models::Beta::PersistedAgentTool::Mcp::ConnectionOrigin)

    Where outbound MCP HTTP connections originate.

  • credential_id (String, nil)

    The vault credential selected for this MCP server, if any.

  • request_metadata (Hash{Symbol=>Object})

    Metadata included with requests to this MCP server.

  • required (Boolean)

    Whether this MCP server must initialize before the first turn.

  • server_label (String)

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

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

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

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

    The type of the object. Always mcp.



# File 'lib/openai/models/beta/persisted_agent_tool.rb', line 163

Instance Attribute Details

#allowed_toolsArray<String>?

The MCP tools the agent may call, or null when all server tools are allowed.

Parameters:

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

Returns:

  • (Array<String>, nil)


119
# File 'lib/openai/models/beta/persisted_agent_tool.rb', line 119

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

#connection_originSymbol, OpenAI::Models::Beta::PersistedAgentTool::Mcp::ConnectionOrigin

Where outbound MCP HTTP connections originate.

Parameters:

  • value (OpenAI::Models::Beta::PersistedAgentTool::Mcp::connection_origin)

Returns:



125
# File 'lib/openai/models/beta/persisted_agent_tool.rb', line 125

required :connection_origin, enum: -> { OpenAI::Beta::PersistedAgentTool::Mcp::ConnectionOrigin }

#credential_idString?

The vault credential selected for this MCP server, if any.

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


131
# File 'lib/openai/models/beta/persisted_agent_tool.rb', line 131

required :credential_id, String, nil?: true

#request_metadataHash{Symbol=>Object}

Metadata included with requests to this MCP server.

Parameters:

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

Returns:

  • (Hash{Symbol=>Object})


137
# File 'lib/openai/models/beta/persisted_agent_tool.rb', line 137

required :request_metadata, OpenAI::Internal::Type::HashOf[OpenAI::Internal::Type::Unknown]

#requiredBoolean

Whether this MCP server must initialize before the first turn.

Parameters:

Returns:



143
# File 'lib/openai/models/beta/persisted_agent_tool.rb', line 143

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

#server_labelString

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

Parameters:

  • value (String)

Returns:

  • (String)


149
# File 'lib/openai/models/beta/persisted_agent_tool.rb', line 149

required :server_label, String

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

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

Parameters:

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

Returns:



155
# File 'lib/openai/models/beta/persisted_agent_tool.rb', line 155

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

#typeSymbol, :mcp

The type of the object. Always mcp.

Parameters:

  • value (:mcp)

Returns:

  • (Symbol, :mcp)


161
# File 'lib/openai/models/beta/persisted_agent_tool.rb', line 161

required :type, const: :mcp

Instance Method Details

#to_hash{

Returns:

  • ({)


117
# File 'sig/openai/models/beta/persisted_agent_tool.rbs', line 117

def to_hash: -> {