json_schema_validate
Validate LLM or agent JSON against a JSON Schema and automatically repair common formatting, type, enum, key, array, and default errors; returns errors, repaired JSON, and applied fixes.
Instructions
Validate LLM/agent JSON output against a JSON Schema (2020-12 subset) and auto-repair typical errors: code fences, trailing commas, numbers/booleans as strings, wrong enum case, single value instead of array, null optionals, extra or mis-cased keys, missing defaults. Returns errors, repaired JSON and fixes. POST recommended. Costs 0.001 USDC on Base per successful call (x402). Without a payment key this tool returns the 402 challenge.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"schema": "<schema>",
"data": "<data>"
},
"name": "json_schema_validate"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | Yes | JSON value or string to check | |
| repair | No | true (default) / false | |
| schema | Yes | JSON Schema |