/** * Type-Safe Tool Handler Utilities * * Provides type-safe wrappers for MCP tool handlers to eliminate * unsafe type assertions (as never) throughout the codebase. */ import { CallToolResult } from '@modelcontextprotocol/sdk/types.js'; import { ZodSchema } from 'zod'; /** * Creates a type-safe tool handler that validates input against a schema * * @param handler - The tool handler function with proper typing * @param schema - Zod schema for runtime validation (handles schemas with defaults) * @returns A wrapper function that safely handles unknown arguments * * @example * const safeHandler = createToolHandler( * executeQueryGraphQL, * queryGraphQLInputSchema * ); * await safeHandler(unknownArgs); */ export declare function createToolHandler(handler: (input: TOutput) => Promise, schema: ZodSchema): (args: unknown) => Promise; //# sourceMappingURL=tool-handler.d.ts.map