mcp-quickbase
Version:
Work with Quickbase via Model Context Protocol
33 lines (32 loc) • 1.2 kB
TypeScript
import { z } from "zod";
/**
* Custom validation error with additional context
*/
export declare class ValidationError extends Error {
readonly context?: {
toolName?: string;
issues?: z.ZodIssue[];
originalParams?: unknown;
} | undefined;
constructor(message: string, context?: {
toolName?: string;
issues?: z.ZodIssue[];
originalParams?: unknown;
} | undefined);
}
/**
* Create Zod schema for MCP server tool registration
* Returns object with property schemas for MCP server
*/
export declare function createMcpZodSchema(schema: Record<string, unknown>): Record<string, z.ZodTypeAny>;
/**
* Create Zod object schema for parameter validation
* Returns complete Zod schema for validation
*/
export declare function createValidationSchema(schema: Record<string, unknown>): z.ZodSchema;
/**
* Validate parameters using JSON Schema with comprehensive error handling
*/
export declare function validateParams<T>(params: unknown, schema: Record<string, unknown>, toolName?: string): T;
export declare const createZodSchema: typeof createMcpZodSchema;
export declare const createZodObjectSchema: typeof createValidationSchema;