Table of Contents

Class Tools

Namespace
OllamaSharp.ModelContextProtocol
Assembly
OllamaSharp.ModelContextProtocol.dll

Contains entry point extensions for the Model Context Protocol (MCP) support.

public static class Tools
Inheritance
Tools
Inherited Members

Methods

GetFromMcpServers(McpClientOptions?, params McpServerConfiguration[])

Gets the tools from the specified MCP server configurations.

public static Task<McpClientTool[]> GetFromMcpServers(McpClientOptions? clientOptions, params McpServerConfiguration[] mcpServers)

Parameters

clientOptions McpClientOptions

The client options to use when connecting to the MCP servers.

mcpServers McpServerConfiguration[]

List of MCP server configurations

Returns

Task<McpClientTool[]>

Exceptions

ArgumentNullException

GetFromMcpServers(params McpServerConfiguration[])

Gets the tools from the specified MCP server configurations.

public static Task<McpClientTool[]> GetFromMcpServers(params McpServerConfiguration[] mcpServers)

Parameters

mcpServers McpServerConfiguration[]

Returns

Task<McpClientTool[]>

Exceptions

ArgumentNullException

GetFromMcpServers(string, McpClientOptions?)

Gets the tools from the specified MCP server configuration file.

public static Task<McpClientTool[]> GetFromMcpServers(string configurationFilePath, McpClientOptions? clientOptions = null)

Parameters

configurationFilePath string

File path to the configuration file.

clientOptions McpClientOptions

The client options to use when connecting to the MCP servers.

Returns

Task<McpClientTool[]>

Exceptions

ArgumentNullException
FileNotFoundException
InvalidOperationException