Class McpClientTool
- Namespace
- OllamaSharp.ModelContextProtocol.Server
- Assembly
- OllamaSharp.ModelContextProtocol.dll
Represents a tool to interact with an MCP server.
public class McpClientTool : Tool, IAsyncInvokableTool
- Inheritance
-
McpClientTool
- Implements
- Inherited Members
Constructors
McpClientTool(McpClientTool, IMcpClient)
Initializes a new instance of McpClientTool using the specified MCP tool metadata and client.
public McpClientTool(McpClientTool mcpTool, IMcpClient client)
Parameters
mcpToolMcpClientToolThe MCP tool definition containing name, description, and JSON schema.
clientIMcpClientThe client used to invoke the underlying MCP calls.
Methods
InvokeMethodAsync(IDictionary<string, object?>?)
Invokes the method asynchronously with the specified arguments.
public Task<object?> InvokeMethodAsync(IDictionary<string, object?>? args)
Parameters
argsIDictionary<string, object>The arguments to pass to the method.