import type { ToolDefinition, ToolInputSchema } from "../../tools/ToolTypes.js"; import type { McpClient, McpToolDefinition } from "./McpClient.js"; /** * Adapts MCP tools into Codali's own tool contract. * * The direction matters: MCP adapts *into* the neutral `ToolDefinition`, never * the reverse. Codali's internals stay decoupled from MCP's evolution, and a * built-in tool, a docdex tool and an MCP tool are indistinguishable to the * planner and the executor. */ /** `mcp::` — the namespace that keeps two servers from colliding. */ export declare const mcpToolName: (server: string, tool: string) => string; export declare const parseMcpToolName: (name: string) => { server: string; tool: string; } | undefined; /** * Normalizes an MCP input schema into Codali's `ToolInputSchema`. * * `additionalProperties` is forced open because the registry rejects unknown * arguments by default, and MCP servers frequently omit properties they still * accept. Rejecting a valid argument is worse here than passing an extra one * through: the server validates its own inputs. */ export declare const normalizeMcpInputSchema: (schema: Record | undefined) => ToolInputSchema; export interface McpToolAdapterOptions { client: McpClient; server: string; /** * Capability group the server's tools belong to, used for the orchestrator's * first-stage selection. Defaults to the server name, which is usually what * an operator means ("github", "jira"). */ capability?: string; /** * Whether these tools may mutate anything. * * Decided by Codali policy — an operator marking a connector read-only — * never by the server's own `readOnlyHint`. A server asserting it is harmless * is the party being constrained vouching for itself. */ readOnly: boolean; /** Result text beyond this is truncated before it reaches a model. */ maxOutputChars?: number; } export declare const mcpToolToDefinition: (tool: McpToolDefinition, options: McpToolAdapterOptions) => ToolDefinition; export declare const mcpToolsToDefinitions: (tools: readonly McpToolDefinition[], options: McpToolAdapterOptions) => ToolDefinition[]; //# sourceMappingURL=McpToolAdapter.d.ts.map