UNPKG

@langchain/mcp-adapters

Version:
19 lines (18 loc) 729 B
import { Client } from "@modelcontextprotocol/sdk/client/index.js"; import { DynamicStructuredTool } from "@langchain/core/tools"; import { type LoadMcpToolsOptions } from "./types.js"; /** * Custom error class for tool exceptions */ export declare class ToolException extends Error { constructor(message: string); } export declare function isToolException(error: unknown): error is ToolException; /** * Load all tools from an MCP client. * * @param serverName - The name of the server to load tools from * @param client - The MCP client * @returns A list of LangChain tools */ export declare function loadMcpTools(serverName: string, client: Client, options?: LoadMcpToolsOptions): Promise<DynamicStructuredTool[]>;