class

OpenAI::MCPTool

Inherits JSON::Serializable < Reference < Object

Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.

Constructors

new(type_value : MCPToolType = MCPToolType::Mcp, server_label : String = "", server_url : String | Nil = nil, connector_id : MCPToolConnectorId | Nil = nil, authorization : String | Nil = nil, server_description : String | Nil = nil, headers : MCPToolHeaders | Nil = nil, allowed_tools : MCPToolAllowedTools | Nil = nil, require_approval : MCPToolRequireApproval | Nil = nil)
Source
new(*, __pull_for_json_serializable pull : JSON::PullParser)
Source

Instance methods

allowed_tools
Source
allowed_tools=(allowed_tools : MCPToolAllowedTools | Nil)
Source
authorization

An OAuth access token that can be used with a remote MCP server, either with a custom MCP server URL or a service connector. Your application must handle the OAuth authorization flow and provide the token here.

Source
authorization=(authorization : String | Nil)

An OAuth access token that can be used with a remote MCP server, either with a custom MCP server URL or a service connector. Your application must handle the OAuth authorization flow and provide the token here.

Source
connector_id

Identifier for service connectors, like those available in ChatGPT. One of server_url or connector_id must be provided. Learn more about service connectors here.

Currently supported connector_id values are:

  • Dropbox: connector_dropbox
  • Gmail: connector_gmail
  • Google Calendar: connector_googlecalendar
  • Google Drive: connector_googledrive
  • Microsoft Teams: connector_microsoftteams
  • Outlook Calendar: connector_outlookcalendar
  • Outlook Email: connector_outlookemail
  • SharePoint: connector_sharepoint
Source
connector_id=(connector_id : MCPToolConnectorId | Nil)

Identifier for service connectors, like those available in ChatGPT. One of server_url or connector_id must be provided. Learn more about service connectors here.

Currently supported connector_id values are:

  • Dropbox: connector_dropbox
  • Gmail: connector_gmail
  • Google Calendar: connector_googlecalendar
  • Google Drive: connector_googledrive
  • Microsoft Teams: connector_microsoftteams
  • Outlook Calendar: connector_outlookcalendar
  • Outlook Email: connector_outlookemail
  • SharePoint: connector_sharepoint
Source
headers
Source
headers=(headers : MCPToolHeaders | Nil)
Source
require_approval
Source
require_approval=(require_approval : MCPToolRequireApproval | Nil)
Source
server_description

Optional description of the MCP server, used to provide more context.

Source
server_description=(server_description : String | Nil)

Optional description of the MCP server, used to provide more context.

Source
server_label

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

Source
server_label=(server_label : String)

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

Source
server_url

The URL for the MCP server. One of server_url or connector_id must be provided.

Source
server_url=(server_url : String | Nil)

The URL for the MCP server. One of server_url or connector_id must be provided.

Source
type_value

The type of the MCP tool. Always mcp.

Source
type_value=(type_value : MCPToolType)

The type of the MCP tool. Always mcp.

Source