import type { CallToolResult } from "@modelcontextprotocol/sdk/types.js"; import type { z } from "zod"; /** * Wraps an MCP tool implementation with the standard parse/try/catch envelope: * * 1. parse `rawInput` through the supplied zod schema (a `ZodObject` or any * schema with `.parse()`), * 2. delegate to `fn(input)`; the function may either return the value to * send back (it will be wrapped with `toolSuccess`), or return a fully * formed tool response (already passed through `toolSuccess`/`toolError`), * 3. surface any thrown error through `toolError`. * * Returning `toolSuccess(...)` from `fn` is detected by shape, so handlers * that need to control the response (e.g. file-storage flows that build a * trimmed summary) can do so without a second helper. */ export declare function createToolHandler(schema: TSchema, fn: (input: z.output) => Promise): (rawInput: unknown) => Promise; //# sourceMappingURL=tool-handler.d.ts.map