import { z } from 'zod'; /** * Recursively parse JSON strings in a value. * * This function handles cases where nested objects are passed as JSON strings * (e.g., from MCP Inspector text fields or MCP clients that send nested objects as strings). * It only attempts to parse strings that look like JSON objects or arrays (starting with `{` or `[`). * * @param value - The value to process * @returns The value with any JSON strings parsed into objects/arrays * * @example * // String that looks like JSON is parsed * deepParseJsonStrings('{"mode": "shades"}') // => { mode: 'shades' } * * // Regular strings are left as-is * deepParseJsonStrings('hello') // => 'hello' * * // Nested objects are processed recursively * deepParseJsonStrings({ primary: '{"mode": "shades"}' }) * // => { primary: { mode: 'shades' } } */ export declare function deepParseJsonStrings(value: unknown): unknown; /** * Create a tool handler with automatic JSON string preprocessing. * * This wrapper ensures that nested objects passed as JSON strings (common when * using MCP Inspector) are properly parsed before schema validation. * * @param schema - The Zod schema for validating the tool's parameters * @param handler - The tool handler function * @returns A wrapped handler that preprocesses inputs before validation * * @example * server.registerTool( * 'create_custom_palette', * { ... }, * withPreprocessing(createCustomPaletteSchema, handleCreateCustomPalette) * ); */ export declare function withPreprocessing>(schema: z.ZodSchema, handler: (params: TParams) => Promise | TResult): (params: unknown) => Promise;