/** * Structured tool failure — the one way tools in this server fail. * * Pattern adapted from @mcp-kit/core (github.com/palimkarakshay/mcp-kit, MIT): * handlers throw `McpToolError` (or anything), the registration wrapper turns * it into an MCP error result instead of crashing the request. */ import type { CallToolResult } from "@modelcontextprotocol/sdk/types.js"; export type ToolErrorCode = "invalid_input" | "not_found" | "internal"; export declare class McpToolError extends Error { readonly code: ToolErrorCode; readonly details?: Record | undefined; constructor(code: ToolErrorCode, message: string, details?: Record | undefined); } /** The caller passed arguments the tool cannot work with. */ export declare function invalidInput(message: string, details?: Record): McpToolError; /** The named thing (rule key, …) does not exist. */ export declare function notFound(message: string, details?: Record): McpToolError; /** Convert any thrown value into a structured MCP error result. */ export declare function errorResult(err: unknown): CallToolResult;