HostedMcpServerTool 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.
Represents a hosted MCP server tool that can be specified to an AI service.
public ref class HostedMcpServerTool : Microsoft::Extensions::AI::AITool
[System.Diagnostics.CodeAnalysis.Experimental("MEAI001")]
public class HostedMcpServerTool : Microsoft.Extensions.AI.AITool
public class HostedMcpServerTool : Microsoft.Extensions.AI.AITool
[<System.Diagnostics.CodeAnalysis.Experimental("MEAI001")>]
type HostedMcpServerTool = class
inherit AITool
type HostedMcpServerTool = class
inherit AITool
Public Class HostedMcpServerTool
Inherits AITool
- Inheritance
- Attributes
Constructors
| Name | Description |
|---|---|
| HostedMcpServerTool(String, String) |
Initializes a new instance of the HostedMcpServerTool class. |
| HostedMcpServerTool(String, Uri) |
Initializes a new instance of the HostedMcpServerTool class. |
Properties
| Name | Description |
|---|---|
| AdditionalProperties |
Gets any additional properties associated with the tool. (Inherited from AITool) |
| AllowedTools |
Gets or sets the list of tools allowed to be used by the AI service. |
| ApprovalMode |
Gets or sets the approval mode that indicates when the AI service should require user approval for tool calls to the remote MCP server. |
| AuthorizationToken |
Gets or sets the OAuth authorization token that the AI service should use when calling the remote MCP server. |
| Description |
Gets a description of the tool, suitable for use in describing the purpose to a model. (Inherited from AITool) |
| Name |
Gets the name of the tool. |
| ServerAddress |
Gets the address of the remote MCP server. This may be a URL, or in the case of a service providing built-in MCP servers with known names, it can be such a name. |
| ServerDescription |
Gets or sets the description of the remote MCP server, used to provide more context to the AI service. |
| ServerName |
Gets the name of the remote MCP server that is used to identify it. |
Methods
| Name | Description |
|---|---|
| GetService(Type, Object) |
Asks the AITool for an object of the specified type |
| GetService<TService>(Object) |
Asks the AITool for an object of type |
| ToString() |
Returns a string that represents the current object. (Inherited from AITool) |
Extension Methods
| Name | Description |
|---|---|
| AsOpenAIResponseTool(AITool) |
Creates an OpenAI ResponseTool from an AITool. |