z-schema 12.x
Use z-schema ^12.0.0 for JSON Schema validation with synchronous and asynchronous APIs, safe results, draft-aware schemas, custom formats, and registered remote references.
- For
z-schema@12.4.5- Verified
- 2026-09-08, 7 examples executed
- Package
@modootoday/pmcp-z-schema@12.0.0
What it covers
- Runtime and defaults
- Synchronous validation
- Safe validation
- Draft-version migration
- Asynchronous validation
- Custom formats
- Remote references
- Recursion
- What this skill does not cover
One example from this skill
This is the skill's own text, not a summary of it. It runs: that is what verifying means here.
import assert from 'node:assert/strict';
import ZSchema from 'z-schema';
const validator = ZSchema.create();
const schema = {
type: 'object',
properties: { answer: { type: 'number' } },
required: ['answer'],
additionalProperties: false,
};
assert.equal(validator.validate({ answer: 42 }, schema), true);
try {
validator.validate({ answer: 'wrong' }, schema);
assert.fail('validation should throw');
} catch (error) {
assert.equal((error as Error).name, 'ValidateError');
assert.ok(Array.isArray((error as { details: unknown[] }).details));
}
What it did in the sandbox
Verifying this skill meant installing the package and running code against it with no route out. This is what happened, quoted from the run. The full ledger lists every package examined, including the ones that never became a skill.
-
prepare: lefthook installthe package -
prepare: lefthook installthe package
Getting it
With a subscription:
npx -y @modootoday/pmcp login
npx -y @modootoday/pmcp install @modootoday/pmcp-z-schema
It installs as a dev dependency of your project, and the MCP server finds it there like any other skill.