/** * Centralized Error Helpers for Memory Journal MCP * * Provides consistent error formatting across all tool handlers. * All errors return structured responses instead of throwing * uncaught exceptions. */ import { ZodError } from 'zod'; import type { ErrorResponse } from '../types/error-types.js'; /** * Extract human-readable messages from a ZodError instead of raw JSON array. * Maps each Zod issue to its path + message for clear validation feedback. */ export declare function formatZodError(error: ZodError): string; /** * Format any caught error into an enriched ErrorResponse. * * Returns structured error information including code, category, * suggestion, and recoverable flag. Handles MemoryJournalMcpError * (full context), ZodError (validation), and raw errors (internal * with pattern-matched suggestions from ERROR_SUGGESTIONS). * * Use as the single catch block for all tool handlers: * * ```typescript * handler: async (params) => { * try { * const parsed = Schema.parse(params); * // ... domain logic ... * return { success: true, ... }; * } catch (err) { * return formatHandlerError(err); * } * } * ``` */ export declare function formatHandlerError(err: unknown): ErrorResponse; //# sourceMappingURL=error-helpers.d.ts.map