Skip to main content
Glama
validation.js612 B
import Ajv from "ajv"; const ajv = new Ajv({ allErrors: true }); export function validateWithErrors(data, schema) { const validate = ajv.compile(schema); const valid = validate(data); if (!valid) { const errors = validate.errors || []; const errorMessages = errors.map((err) => { const path = err.instancePath || ''; const message = err.message || 'Validation error'; return path ? `${path}: ${message}` : message; }); throw new Error(`Validation failed: ${errorMessages.join(', ')}`); } } //# sourceMappingURL=validation.js.map

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/waldzellai/clearthought-onepointfive'

If you have feedback or need assistance with the MCP directory API, please join our Discord server