import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js'; import type { ToolAnnotations } from '@modelcontextprotocol/sdk/types.js'; import { z } from 'zod'; import type { DepotMcpConfig } from '../config.js'; import type { DepotApi } from '../depot/api.js'; export interface ToolContext { readonly api: DepotApi; readonly config: DepotMcpConfig; /** Pause between polls. Injected so the test suite can wait without waiting. */ readonly sleep: (ms: number) => Promise; /** Clock, injected alongside `sleep` so a fake sleep can advance a fake clock. */ readonly now: () => number; } export interface ToolOutcome { /** Prose the model reads by default. Must already respect the configured character budget. */ readonly summary: string; readonly data: TData; } /** Thrown when a request is well-formed but cannot be satisfied; surfaced as a tool error. */ export declare class ToolInputError extends Error { constructor(message: string); } export interface ToolSpec { readonly name: string; readonly title: string; readonly description: string; readonly inputSchema: TInput; readonly outputSchema: TOutput; readonly annotations?: Partial | undefined; readonly handler: (input: z.output>, context: ToolContext) => Promise>>>; } export interface ToolModule { readonly name: string; readonly title: string; readonly description: string; readonly annotations: ToolAnnotations; register(server: McpServer, context: ToolContext): void; } /** * Wraps a tool spec so registration, argument parsing, output validation and Depot error * translation happen in exactly one place. Erasing the schema generics behind `ToolModule` keeps * heterogeneous tools storable in a single list. */ export declare function defineTool(spec: ToolSpec): ToolModule; //# sourceMappingURL=tool.d.ts.map