struct AI::OpenAI::Tools::Mcp

Overview

MCP (Model Context Protocol) tool.

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

Defined in:

ai/openai/tool/openai_tools.cr

Constant Summary

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

Constructors

Instance Method Summary

Constructor Detail

def self.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) #

[View source]

Instance Method Detail

def allowed_tools : Array(String) | AllowedToolsFilter | Nil #

Allowed tool names or filter object.


[View source]
def args : Hash(String, JSON::Any) #

[View source]
def authorization : String | Nil #

OAuth access token for the MCP server/connector.


[View source]
def connector_id : String | Nil #

Identifier for a service connector.


[View source]
def headers : Hash(String, String) | Nil #

Optional headers to include in MCP requests.


[View source]
def id : String #

[View source]
def name : String #

[View source]
def require_approval : String | RequireApprovalFilter | Nil #

Approval policy.


[View source]
def server_description : String | Nil #

Optional description of the server.


[View source]
def server_label : String #

Label to identify the MCP server.


[View source]
def server_url : String | Nil #

URL for the MCP server.


[View source]
def type : String #

[View source]