HTTP/1.1 402 PAYMENT REQUIRED agent402.base.eth · BASE · SOLANA · POLYGON · ARBITRUM · MONAD · STELLAR · ALGORAND · ROBINHOOD · USDC · USDG

Schema guard

Contract-test a JSON payload in one call: validate it against your schema, infer the schema the payload actually implies, diff the two to expose drift, and return a normalized pretty-print.

When to use this pack

An agent consuming a third-party API or another agent's structured output needs to know — before trusting the data — whether the payload still matches the agreed contract, and if not, exactly which fields drifted.

Tools in this pack

Workflow

  1. Validate the payload against the expected schema with json-validate — the pass/fail verdict with the exact violation list.
  2. Infer the schema the payload actually implies with json-schema-infer — types, required keys, formats.
  3. Diff the expected schema against the inferred one with json-diff — the drift report: added fields, changed types, dropped keys.
  4. Normalize the payload with json-format for a canonical pretty-printed copy to log or store.

Run it in Claude

claude mcp add agent402 -s user -- npx -y agent402-mcp@latest

Then paste this prompt into Claude:

Contract-test this JSON payload using Agent402's schema-guard skill pack: {"id":1,"name":"Ada"} against the expected schema {"type":"object","required":["id"]}. (1) Validate the payload against the schema, (2) infer the schema the payload actually implies, (3) diff expected vs inferred to expose drift, (4) return the normalized pretty-print. Report: valid or not (with violations), and every drifted field with its old vs new type.

← All skill packs