/** * Create a successful MCP tool response * @param {any} data - The data to return * @param {string} mimeType - Optional MIME type (defaults to 'application/json') * @returns {Object} MCP-compliant response */ export function createToolResponse(data: any, mimeType?: string): Object; /** * Create an error response following JSON-RPC 2.0 error codes * @param {number} code - JSON-RPC error code * @param {string} message - Error message * @param {any} data - Additional error data * @returns {Object} JSON-RPC compliant error */ export function createErrorResponse(code: number, message: string, data?: any): Object; /** * Create a paginated response with cursor support * @param {Array} items - Array of items * @param {Object} options - Pagination options * @param {Object} metadata - Optional metadata (e.g., { isStub: boolean, dataSource: string }) * @returns {Object} Paginated response with cursor */ export function createPaginatedResponse(items: any[], options?: Object, metadata?: Object): Object; /** * Wrap an async tool handler with proper error handling * @param {Function} handler - The async handler function * @returns {Function} Wrapped handler with MCP-compliant error handling */ export function wrapToolHandler(handler: Function): Function; /** * Validate tool arguments against a schema * @param {Object} args - Arguments to validate * @param {Object} schema - Zod schema or similar * @returns {Object} Validated arguments * @throws {Object} JSON-RPC error if validation fails */ export function validateArgs(args: Object, schema: Object): Object; /** * Log MCP tool invocation for monitoring * @param {string} toolName - Name of the tool * @param {Object} args - Tool arguments * @param {Object} extra - Extra context from MCP * @returns {number} Start timestamp for duration tracking */ export function logToolInvocation(toolName: string, args: Object, extra: Object): number; export namespace ErrorCodes { let PARSE_ERROR: number; let INVALID_REQUEST: number; let METHOD_NOT_FOUND: number; let INVALID_PARAMS: number; let INTERNAL_ERROR: number; let RESOURCE_NOT_FOUND: number; let RESOURCE_ACCESS_DENIED: number; let RESOURCE_UNAVAILABLE: number; let BACKEND_ERROR: number; }