Share via


HostedMcpServerTool Constructors

Definition

Overloads

Name Description
HostedMcpServerTool(String, String)

Initializes a new instance of the HostedMcpServerTool class.

HostedMcpServerTool(String, Uri)

Initializes a new instance of the HostedMcpServerTool class.

HostedMcpServerTool(String, String)

Source:
HostedMcpServerTool.cs

Initializes a new instance of the HostedMcpServerTool class.

public:
 HostedMcpServerTool(System::String ^ serverName, System::String ^ serverAddress);
public HostedMcpServerTool(string serverName, string serverAddress);
new Microsoft.Extensions.AI.HostedMcpServerTool : string * string -> Microsoft.Extensions.AI.HostedMcpServerTool
Public Sub New (serverName As String, serverAddress As String)

Parameters

serverName
String

The name of the remote MCP server.

serverAddress
String

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.

Exceptions

serverName or serverAddress is null.

serverName or serverAddress is empty or composed entirely of whitespace.

Applies to

HostedMcpServerTool(String, Uri)

Source:
HostedMcpServerTool.cs

Initializes a new instance of the HostedMcpServerTool class.

public:
 HostedMcpServerTool(System::String ^ serverName, Uri ^ serverUrl);
public HostedMcpServerTool(string serverName, Uri serverUrl);
new Microsoft.Extensions.AI.HostedMcpServerTool : string * Uri -> Microsoft.Extensions.AI.HostedMcpServerTool
Public Sub New (serverName As String, serverUrl As Uri)

Parameters

serverName
String

The name of the remote MCP server.

serverUrl
Uri

The URL of the remote MCP server.

Exceptions

serverName or serverUrl is null.

serverUrl is not an absolute URL.

Applies to