/** * Query Helpers — Input Coercion Utilities * * Standard coercion helpers that safely convert MCP SDK inputs (which may * arrive as strings due to JSON serialization) into their expected types. * * Used with `z.preprocess()` to ensure bad input reaches the handler's * try/catch instead of causing raw -32602 protocol errors. */ /** Default number of rows returned by query tools */ export declare const DEFAULT_QUERY_LIMIT = 100; /** * Coerce a value to a number. Returns `undefined` for non-numeric input * so Zod treats it as "not provided" instead of producing NaN. * * Usage: `z.preprocess(coerceNumber, z.number().optional())` */ export declare function coerceNumber(val: unknown): unknown; /** * Coerce a value to a boolean. Handles string "true"/"false" from * MCP SDK serialization. * * Usage: `z.preprocess(coerceBoolean, z.boolean().optional())` */ export declare function coerceBoolean(val: unknown): unknown; /** * Coerce a raw limit value to a usable number. * - `undefined` → `defaultLimit` * - `NaN` → `defaultLimit` * - `0` → `null` (meaning "unlimited") * - negative → `defaultLimit` * - positive → the value itself * * Works with both `z.preprocess(coerceNumber, ...)` and `z.coerce.number()` * outputs, safely handling NaN and undefined. */ export declare function coerceLimit(raw: unknown, defaultLimit?: number): number | null; /** * Build a SQL LIMIT clause from a coerced limit value. * `null` means "no limit" — returns an empty string. */ export declare function buildLimitClause(limitVal: number | null): string; //# sourceMappingURL=query-helpers.d.ts.map