pub struct McpTool {
pub server_label: String,
pub server_url: Option<String>,
pub connector_id: Option<ConnectorId>,
pub authorization: Option<String>,
pub server_description: Option<String>,
pub headers: Option<IndexMap<String, String>>,
pub allowed_tools: Option<AllowedTools>,
pub require_approval: Option<RequireApproval>,
}
Expand description
Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
Fields§
§server_label: String
A label for this MCP server, used to identify it in tool calls.
server_url: Option<String>
The URL for the MCP server. One of server_url
or connector_id
must be
provided.
connector_id: Option<ConnectorId>
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
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.
server_description: Option<String>
Optional description of the MCP server, used to provide more context.
headers: Option<IndexMap<String, String>>
Optional HTTP headers to send to the MCP server. Use for authentication or other purposes.
allowed_tools: Option<AllowedTools>
List of allowed tool names or a filter object.
require_approval: Option<RequireApproval>
Specify which of the MCP server’s tools require approval.
Implementations§
Source§impl McpTool
impl McpTool
Sourcepub fn builder() -> McpToolBuilder<((), (), (), (), (), (), (), ())>
pub fn builder() -> McpToolBuilder<((), (), (), (), (), (), (), ())>
Create a builder for building McpTool
.
On the builder, call .server_label(...)
, .server_url(...)
(optional), .connector_id(...)
(optional), .authorization(...)
(optional), .server_description(...)
(optional), .headers(...)
(optional), .allowed_tools(...)
(optional), .require_approval(...)
(optional) to set the values of the fields.
Finally, call .build()
to create the instance of McpTool
.