Table of Contents

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 with metadata about the original method.

public McpClientTool(McpClientTool mcpTool, IMcpClient client)

Parameters

mcpTool McpClientTool
client IMcpClient

Methods

InvokeMethodAsync(IDictionary<string, object?>?)

Invokes the method asynchronously with the specified arguments.

public Task<object?> InvokeMethodAsync(IDictionary<string, object?>? args)

Parameters

args IDictionary<string, object>

The arguments to pass to the method.

Returns

Task<object>

A task that represents the asynchronous operation. The task result contains the result of the method invocation.