Class: OpenAI::Models::Responses::Tool::Mcp

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/openai/models/responses/tool.rb

Defined Under Namespace

Modules: AllowedTools, RequireApproval

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Internal::Type::BaseModel

==, #==, #[], coerce, #deconstruct_keys, #deep_to_h, dump, 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, #dump, dump, #inspect, inspect, 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: , server_url: , allowed_tools: nil, headers: nil, require_approval: nil, type: :mcp) ⇒ Object

Some parameter documentations has been truncated, see OpenAI::Models::Responses::Tool::Mcp for more details.

Give the model access to additional tools via remote Model Context Protocol (MCP) servers. [Learn more about MCP](platform.openai.com/docs/guides/tools-remote-mcp).

Parameters:



# File 'lib/openai/models/responses/tool.rb', line 77

Instance Attribute Details

#allowed_toolsArray<String>, ...

List of allowed tool names or a filter object.



62
# File 'lib/openai/models/responses/tool.rb', line 62

optional :allowed_tools, union: -> { OpenAI::Responses::Tool::Mcp::AllowedTools }, nil?: true

#headersHash{Symbol=>String}?

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

Returns:

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


69
# File 'lib/openai/models/responses/tool.rb', line 69

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

#require_approvalOpenAI::Models::Responses::Tool::Mcp::RequireApproval::McpToolApprovalFilter, ...

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



75
# File 'lib/openai/models/responses/tool.rb', line 75

optional :require_approval, union: -> { OpenAI::Responses::Tool::Mcp::RequireApproval }, nil?: true

#server_labelString

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

Returns:

  • (String)


44
# File 'lib/openai/models/responses/tool.rb', line 44

required :server_label, String

#server_urlString

The URL for the MCP server.

Returns:

  • (String)


50
# File 'lib/openai/models/responses/tool.rb', line 50

required :server_url, String

#typeSymbol, :mcp

The type of the MCP tool. Always ‘mcp`.

Returns:

  • (Symbol, :mcp)


56
# File 'lib/openai/models/responses/tool.rb', line 56

required :type, const: :mcp