HTTP/1.1 402 PAYMENT REQUIRED · x402 + MPP dual-stack 500+ tools · 12 rails · 0% seller fee

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.

$0.050 per call · one payment for the whole workflow
POST /api/skill/schema-guard

4 tools run server-side in one request. You pay once, settle once, and get a single response - no orchestration, no per-step payments, and a partial-success envelope if any step fails. USDC over x402 on any supported chain.

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

All 4 run inside the single $0.050 call above. Each is also callable on its own if you only need one part.

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.

Call it directly

Any x402 client pays the 402 and gets the whole workflow back in one response:

npx agent402-client call schema-guard {"payload":"{\"id\":1,\"name\":\"Ada\"}","schema":"{\"type\":\"object\",\"required\":[\"id\"]}"}

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