struct

AI::OpenAI::Tools::Mcp

Inherits Struct < Value < Object

MCP (Model Context Protocol) tool.

Allows models to call tools exposed by remote MCP servers or service connectors.

Constants

ID = "openai.mcp"
NAME = "mcp"

Constructors

new(server_label : String, allowed_tools : Array(String) | AllowedToolsFilter | Nil = nil, authorization : String | Nil = nil, connector_id : String | Nil = nil, headers : Hash(String, String) | Nil = nil, require_approval : String | RequireApprovalFilter | Nil = nil, server_description : String | Nil = nil, server_url : String | Nil = nil)
Source

Instance methods

allowed_tools

Allowed tool names or filter object.

Source
args
Source
authorization

OAuth access token for the MCP server/connector.

Source
connector_id

Identifier for a service connector.

Source
headers

Optional headers to include in MCP requests.

Source
name
Source
require_approval

Approval policy.

Source
server_description

Optional description of the server.

Source
server_label

Label to identify the MCP server.

Source
server_url

URL for the MCP server.

Source
type
Source