MCPTool Class

Definition

MCP tool.

public class MCPTool : Azure.AI.AgentServer.Responses.Models.Tool, System.ClientModel.Primitives.IJsonModel<Azure.AI.AgentServer.Responses.Models.MCPTool>, System.ClientModel.Primitives.IPersistableModel<Azure.AI.AgentServer.Responses.Models.MCPTool>
type MCPTool = class
    inherit Tool
    interface IJsonModel<MCPTool>
    interface IPersistableModel<MCPTool>
Public Class MCPTool
Inherits Tool
Implements IJsonModel(Of MCPTool), IPersistableModel(Of MCPTool)
Inheritance
MCPTool
Implements

Constructors

Name Description
MCPTool(String)

Initializes a new instance of MCPTool.

Properties

Name Description
AllowedTools

Gets or sets the AllowedTools.

To assign an object to this property use FromObjectAsJson<T>(T, JsonSerializerOptions).

To assign an already formatted json string to this property use FromString(String).

<remarks> Supported types:

</remarks>

Examples:

  • BinaryData.FromObjectAsJson("foo"). : Creates a payload of "foo".
  • BinaryData.FromString("\"foo\""). : Creates a payload of "foo".
  • BinaryData.FromObjectAsJson(new { key = "value" }). : Creates a payload of { "key": "value" }.
  • BinaryData.FromString("{\"key\": \"value\"}"). : Creates a payload of { "key": "value" }.

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.

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`
Headers

Gets or sets the Headers.

ProjectConnectionId

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.

RequireApproval

Gets or sets the RequireApproval.

To assign an object to this property use FromObjectAsJson<T>(T, JsonSerializerOptions).

To assign an already formatted json string to this property use FromString(String).

<remarks> Supported types:

</remarks>

Examples:

  • BinaryData.FromObjectAsJson("foo"). : Creates a payload of "foo".
  • BinaryData.FromString("\"foo\""). : Creates a payload of "foo".
  • BinaryData.FromObjectAsJson(new { key = "value" }). : Creates a payload of { "key": "value" }.
  • BinaryData.FromString("{\"key\": \"value\"}"). : Creates a payload of { "key": "value" }.

ServerDescription

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

ServerLabel

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

ServerUrl

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

Methods

Name Description
JsonModelCreateCore(Utf8JsonReader, ModelReaderWriterOptions)
JsonModelWriteCore(Utf8JsonWriter, ModelReaderWriterOptions)
PersistableModelCreateCore(BinaryData, ModelReaderWriterOptions)
PersistableModelWriteCore(ModelReaderWriterOptions)

Explicit Interface Implementations

Name Description
IJsonModel<MCPTool>.Create(Utf8JsonReader, ModelReaderWriterOptions)
IJsonModel<MCPTool>.Write(Utf8JsonWriter, ModelReaderWriterOptions)
IJsonModel<Tool>.Create(Utf8JsonReader, ModelReaderWriterOptions) (Inherited from Tool)
IJsonModel<Tool>.Write(Utf8JsonWriter, ModelReaderWriterOptions) (Inherited from Tool)
IPersistableModel<MCPTool>.Create(BinaryData, ModelReaderWriterOptions)
IPersistableModel<MCPTool>.GetFormatFromOptions(ModelReaderWriterOptions)
IPersistableModel<MCPTool>.Write(ModelReaderWriterOptions)
IPersistableModel<Tool>.Create(BinaryData, ModelReaderWriterOptions) (Inherited from Tool)
IPersistableModel<Tool>.GetFormatFromOptions(ModelReaderWriterOptions) (Inherited from Tool)
IPersistableModel<Tool>.Write(ModelReaderWriterOptions) (Inherited from Tool)

Applies to