import type { Prompt, Resource, Tool as MCPTool } from "@modelcontextprotocol/client"; import type { BaseConnector } from "@mcp-use/client"; import type { ProviderTool } from "../llm/types.js"; import { BaseAdapter } from "./base.js"; /** Native tool definition paired with its internal dispatch route. */ export interface NativeToolEntry extends ProviderTool { /** Internal dispatch key (may differ from MCP name after dedup). */ dispatchKey: string; } /** Invokes a native adapter tool by its exposed name. */ export type NativeCallToolFn = (name: string, args: Record) => Promise; /** * Converts MCP tools, resources, and prompts into provider-neutral tools. * * The adapter also creates a dispatcher that routes model tool calls back to * the connector that supplied each tool. */ export declare class NativeAdapter extends BaseAdapter { private usedToolNames; private handlers; /** * @param disallowedTools - MCP tool names to omit during conversion. */ constructor(disallowedTools?: string[]); /** * Converts MCP tools from all connectors and resets the dispatch table. * * @param connectors - Connected MCP connectors. * @returns Provider-neutral tool entries. */ createToolsFromConnectors(connectors: BaseConnector[]): Promise; /** * Creates a dispatcher for the entries loaded by this adapter. * * @returns A function that invokes tools, reads resources, or gets prompts. * @throws Error if the requested exposed tool name is unknown. */ createCallTool(): NativeCallToolFn; /** * Removes internal dispatch metadata from native tool entries. * * @param entries - Entries created by this adapter. * @returns Provider-neutral definitions safe to send to an LLM provider. */ toProviderTools(entries: NativeToolEntry[]): ProviderTool[]; private reserveName; private register; protected convertTool(mcpTool: MCPTool, connector: BaseConnector): NativeToolEntry | null; protected convertResource(mcpResource: Resource, connector: BaseConnector): NativeToolEntry | null; protected convertPrompt(mcpPrompt: Prompt, connector: BaseConnector): NativeToolEntry | null; } //# sourceMappingURL=native_adapter.d.ts.map