// JSON-RPC error codes
export const JSON_RPC_ERROR_CODES = Object.freeze({
    PARSE_ERROR: -32700,
    INVALID_REQUEST: -32600,
    METHOD_NOT_FOUND: -32601,
    INVALID_PARAMS: -32602,
    INTERNAL_ERROR: -32603,
    RESOURCE_NOT_FOUND: -32002
});
export class ToolError extends Error {
    code;
    constructor(code, message) {
        if (!Number.isFinite(code)) {
            throw new Error("ToolError code must be a finite number");
        }
        super(message);
        this.code = code;
        this.name = "ToolError";
    }
}
