zod schema validation 3.x
Parse at the boundary, read the failure, and let the schema be the type.
Written for 3.x, which is no
longer revised. The verification date below is where this line stopped,
not a date that will move again.
Other lines of this skill:
4.x (active, for zod@^4.0.0).
- For
zod@3.25.76- Verified
- 2026-09-07, 7 examples executed
- Package
@modootoday/pmcp-zod-schema-validation@3.0.0
What it covers
- Import and version boundary
- Primitive schemas and parsing
- Object schemas and inferred types
- Coercion
- Custom messages
- Tuples and rest elements
- Selective partial objects
- Records
- Async parsing
- Common version and shape mistakes
- Not covered
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 { z } from "zod";
import assert from "node:assert/strict";
const schema = z.string();
assert.equal(schema.parse("tuna"), "tuna");
assert.throws(() => schema.parse(12));
const valid = schema.safeParse("tuna");
assert.equal(valid.success, true);
if (valid.success) assert.equal(valid.data, "tuna");
const invalid = schema.safeParse(12);
assert.equal(invalid.success, false);
What it did in the sandbox
Verifying this skill meant installing the package and running code against it with no route out. Nothing was observed. The full ledger lists every package examined, including the ones that never became a skill.
Nothing observed is not a finding of safety. It means one run, under one policy, produced nothing to report.
Getting it
With a subscription:
npx -y @modootoday/pmcp login
npx -y @modootoday/pmcp install @modootoday/pmcp-zod-schema-validation
It installs as a dev dependency of your project, and the MCP server finds it there like any other skill.