MCPTool Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
public class MCPTool : Azure.AI.AgentServer.Contracts.Generated.OpenAI.Tool, System.ClientModel.Primitives.IJsonModel<Azure.AI.AgentServer.Contracts.Generated.OpenAI.MCPTool>, System.ClientModel.Primitives.IPersistableModel<Azure.AI.AgentServer.Contracts.Generated.OpenAI.MCPTool>
type MCPTool = class
inherit Tool
interface IUtf8JsonSerializable
interface IJsonModel<MCPTool>
interface IPersistableModel<MCPTool>
Public Class MCPTool
Inherits Tool
Implements IJsonModel(Of MCPTool), IPersistableModel(Of MCPTool)
- Inheritance
- Implements
Constructors
| Name | Description |
|---|---|
| MCPTool() |
Initializes a new instance of MCPTool for deserialization. |
| MCPTool(String, String) |
Initializes a new instance of MCPTool. |
| MCPTool(ToolType, IDictionary<String,BinaryData>, String, String, IDictionary<String,String>, BinaryData, BinaryData, String) |
Initializes a new instance of MCPTool. |
Properties
| Name | Description |
|---|---|
| AllowedTools |
List of allowed tool names or a filter object. 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:
|
| Headers |
Optional HTTP headers to send to the MCP server. Use for authentication or other purposes. |
| 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 |
Specify which of the MCP server's tools require approval. 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:
|
| ServerLabel |
A label for this MCP server, used to identify it in tool calls. |
| ServerUrl |
The URL for the MCP server. |
| Type |
Gets or sets the type. (Inherited from Tool) |
Methods
| Name | Description |
|---|---|
| DeserializeMCPTool(JsonElement, ModelReaderWriterOptions) | |
| FromResponse(Response) |
Deserializes the model from a raw response. |
| JsonModelWriteCore(Utf8JsonWriter, ModelReaderWriterOptions) | |
| ToRequestContent() |
Convert into a RequestContent. |