AJV-backed JSON Schema validator. See @modelcontextprotocol/{client,server}/validators/ajv for the customisation entry point (re-exports Ajv and addFormats from the bundled copy).
@modelcontextprotocol/{client,server}/validators/ajv
Ajv
addFormats
const validator = new AjvJsonSchemaValidator(); Copy
const validator = new AjvJsonSchemaValidator();
const ajv = new Ajv({ strict: true, allErrors: true });const validator = new AjvJsonSchemaValidator(ajv); Copy
const ajv = new Ajv({ strict: true, allErrors: true });const validator = new AjvJsonSchemaValidator(ajv);
const ajv = new Ajv({ strict: true, allErrors: true });addFormats(ajv);const validator = new AjvJsonSchemaValidator(ajv); Copy
const ajv = new Ajv({ strict: true, allErrors: true });addFormats(ajv);const validator = new AjvJsonSchemaValidator(ajv);
Create a validator for the given JSON Schema
Standard JSON Schema object
A validator function that can be called multiple times
AJV-backed JSON Schema validator. See
@modelcontextprotocol/{client,server}/validators/ajvfor the customisation entry point (re-exportsAjvandaddFormatsfrom the bundled copy).Example: Use with default configuration
Example: Use with a custom AJV instance
Example: Register ajv-formats