import type { ToolResult } from '../types/index.js';
/**
 * Wraps a tool handler so that any unhandled error is caught and returned as a
 * graceful MCP error response, preventing server crashes.
 *
 * Usage:
 *   server.registerTool('my_tool', schema, safe(async (args) => { ... }));
 */
export declare function safe<T>(handler: (args: T) => Promise<ToolResult>): (args: T) => Promise<ToolResult>;
/**
 * Composable wrapper: license gate + error boundary.
 * Use for tools that require a paid plan. Free tools should use safe() directly.
 *
 * Usage:
 *   server.registerTool('pro_tool', schema, safeLicensed('pro_tool', async (args) => { ... }));
 */
export declare function safeLicensed<T>(toolName: string, handler: (args: T) => Promise<ToolResult>): (args: T) => Promise<ToolResult>;
//# sourceMappingURL=safe-handler.d.ts.map