Repair near-miss LLM JSON to a schema (paid $0.002)
json_repairRepair malformed LLM JSON to conform to a JSON Schema, returning the corrected object or precise field errors.
Instructions
PAID $0.002 (x402, USDC on Base). Coerce near-miss LLM JSON to a JSON-Schema-conformant object: strip code fences/prose, fix trailing commas/quotes/unquoted keys, normalise Python literals, balance brackets, then coerce types, apply defaults, and drop extraneous keys. Returns the repaired object OR precise per-field errors. Args: json (the raw string), schema (a JSON Schema object). Without payment returns the x402 challenge.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| json | Yes | The raw, possibly-malformed JSON text to repair. | |
| schema | Yes | A JSON Schema (draft 2020-12) object the result must conform to. | |
| x_payment | No | x402 payment payload (base64) for this PAID check. If supplied it is forwarded as the X-PAYMENT header to settle the call and return the real result instead of a 402 challenge. Omit to get the price challenge first. |