@langchain/mcp-adapters
Version:
LangChain.js adapters for Model Context Protocol (MCP)
1 lines • 1.69 kB
Source Map (JSON)
{"version":3,"file":"tools.d.cts","names":["Client","MCPClient","DynamicStructuredTool","LoadMcpToolsOptions","MCPInstance","ToolException","Error","isToolException","loadMcpTools","Promise"],"sources":["../src/tools.d.ts"],"sourcesContent":["import type { Client as MCPClient } from \"@modelcontextprotocol/sdk/client/index.js\";\nimport { DynamicStructuredTool } from \"@langchain/core/tools\";\nimport { type LoadMcpToolsOptions } from \"./types.js\";\nimport type { Client } from \"./connection.js\";\n/**\n * MCP instance is either a Client or a MCPClient.\n *\n * `MCPClient`: is the base instance from the `@modelcontextprotocol/sdk` package.\n * `Client`: is an extension of the `MCPClient` that adds the `fork` method to easier create a new client with different headers.\n *\n * This distinction is necessary to keep the interface of the `getTools` method simple.\n */\ntype MCPInstance = Client | MCPClient;\n/**\n * Custom error class for tool exceptions\n */\nexport declare class ToolException extends Error {\n constructor(message: string, cause?: Error);\n}\nexport declare function isToolException(error: unknown): error is ToolException;\n/**\n * Load all tools from an MCP client.\n *\n * @param serverName - The name of the server to load tools from\n * @param client - The MCP client\n * @returns A list of LangChain tools\n */\nexport declare function loadMcpTools(serverName: string, client: MCPInstance, options?: LoadMcpToolsOptions): Promise<DynamicStructuredTool[]>;\nexport {};\n//# sourceMappingURL=tools.d.ts.map"],"mappings":";;;;;;;;;AAG8C;AAwB9C;;;;;AAAqH,KAfhHI,WAAAA,GAAcJ,MAekG,GAfzFC,QAeyF;;;;;;;;;;;;iBAA7FO,YAAAA,6BAAyCJ,uBAAuBD,sBAAsBM,QAAQP"}