Språk

ProjectsAgentsModelFactory.MCPToolboxTool Method

Definition

An MCP tool stored in a toolbox.

public static Azure.AI.Projects.Agents.MCPToolboxTool MCPToolboxTool(string name = default, string description = default, System.Collections.Generic.IDictionary<string,Azure.AI.Extensions.OpenAI.ToolConfig> toolConfigs = default, string serverLabel = default, Uri serverUri = default, OpenAI.Responses.McpToolConnectorId? connectorId = default, string tunnelId = default, string authorization = default, string serverDescription = default, System.Collections.Generic.IDictionary<string,string> headers = default, OpenAI.Responses.McpToolFilter allowedTools = default, System.Collections.Generic.IEnumerable<Azure.AI.Projects.Agents.CallableToolAllowedCaller> allowedCallers = default, BinaryData requireApprovalInternal = default, bool? deferLoading = default, string projectConnectionId = default);
static member MCPToolboxTool : string * string * System.Collections.Generic.IDictionary<string, Azure.AI.Extensions.OpenAI.ToolConfig> * string * Uri * Nullable<OpenAI.Responses.McpToolConnectorId> * string * string * string * System.Collections.Generic.IDictionary<string, string> * OpenAI.Responses.McpToolFilter * seq<Azure.AI.Projects.Agents.CallableToolAllowedCaller> * BinaryData * Nullable<bool> * string -> Azure.AI.Projects.Agents.MCPToolboxTool
Public Shared Function MCPToolboxTool (Optional name As String = Nothing, Optional description As String = Nothing, Optional toolConfigs As IDictionary(Of String, ToolConfig) = Nothing, Optional serverLabel As String = Nothing, Optional serverUri As Uri = Nothing, Optional connectorId As Nullable(Of McpToolConnectorId) = Nothing, Optional tunnelId As String = Nothing, Optional authorization As String = Nothing, Optional serverDescription As String = Nothing, Optional headers As IDictionary(Of String, String) = Nothing, Optional allowedTools As McpToolFilter = Nothing, Optional allowedCallers As IEnumerable(Of CallableToolAllowedCaller) = Nothing, Optional requireApprovalInternal As BinaryData = Nothing, Optional deferLoading As Nullable(Of Boolean) = Nothing, Optional projectConnectionId As String = Nothing) As MCPToolboxTool

Parameters

name
String

Optional user-defined name for this tool or configuration.

description
String

Optional user-defined description for this tool or configuration.

toolConfigs
IDictionary<String,ToolConfig>

Per-tool configuration map. Keys are tool names or * (catch-all default). Resolution order: exact tool name match takes priority over *. Unknown tool names are silently ignored at runtime.

serverLabel
String

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

serverUri
Uri

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

connectorId
Nullable<OpenAI.Responses.McpToolConnectorId>

Identifier for service connectors, like those available in ChatGPT. One of server_url, connector_id, or tunnel_id must be provided. Learn more about service connectors here. This field is deprecated for models released after September 1, 2026. Use server_url to connect to a remote MCP server, or tunnel_id to connect through a Secure MCP Tunnel. 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`
tunnelId
String

The Secure MCP Tunnel ID to use instead of a direct server URL. One of server_url, connector_id, or tunnel_id must be provided.

authorization
String

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.

serverDescription
String

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

allowedTools
OpenAI.Responses.McpToolFilter
requireApprovalInternal
BinaryData
deferLoading
Nullable<Boolean>

Whether this MCP tool is deferred and discovered via tool search.

projectConnectionId
String

The connection ID in the project for the MCP server. The connection stores authentication and other connection details needed to connect to the MCP server.

Returns

A new MCPToolboxTool instance for mocking.

Applies to