Freigeben über


McpToolServerConfigurationService.EnumerateToolsFromServersAsync Method

Definition

Enumerates all MCP tools from configured servers for a given agent.

public virtual System.Threading.Tasks.Task<(System.Collections.Generic.List<Microsoft.Agents.A365.Tooling.Models.MCPServerConfig> Servers, System.Collections.Generic.Dictionary<string,System.Collections.Generic.IList<ModelContextProtocol.Client.McpClientTool>> ToolsByServer)> EnumerateToolsFromServersAsync(string agentInstanceId, string authToken, Microsoft.Agents.Builder.ITurnContext turnContext, Microsoft.Agents.A365.Tooling.Models.ToolOptions toolOptions);
abstract member EnumerateToolsFromServersAsync : string * string * Microsoft.Agents.Builder.ITurnContext * Microsoft.Agents.A365.Tooling.Models.ToolOptions -> System.Threading.Tasks.Task<ValueTuple<System.Collections.Generic.List<Microsoft.Agents.A365.Tooling.Models.MCPServerConfig>, System.Collections.Generic.Dictionary<string, System.Collections.Generic.IList<ModelContextProtocol.Client.McpClientTool>>>>
override this.EnumerateToolsFromServersAsync : string * string * Microsoft.Agents.Builder.ITurnContext * Microsoft.Agents.A365.Tooling.Models.ToolOptions -> System.Threading.Tasks.Task<ValueTuple<System.Collections.Generic.List<Microsoft.Agents.A365.Tooling.Models.MCPServerConfig>, System.Collections.Generic.Dictionary<string, System.Collections.Generic.IList<ModelContextProtocol.Client.McpClientTool>>>>
Public Overridable Function EnumerateToolsFromServersAsync (agentInstanceId As String, authToken As String, turnContext As ITurnContext, toolOptions As ToolOptions) As Task(Of ValueTuple(Of List(Of MCPServerConfig), Dictionary(Of String, IList(Of McpClientTool))))

Parameters

agentInstanceId
String

The agent instance ID.

authToken
String

Authentication token for MCP server access.

turnContext
ITurnContext

Turn context for the current request.

toolOptions
ToolOptions

Tool options including user agent configuration.

Returns

Task<ValueTuple<List<MCPServerConfig>,Dictionary<String,IList<ModelContextProtocol.Client.McpClientTool>>>>

A tuple containing server configurations and a dictionary mapping server names to their available tools.

Implements

Applies to