JSON repair for LLM output: fixes broken JSON and checks it against your schema
repair_jsonTurns messy LLM output into valid JSON: strips Markdown code fences and surrounding prose, fixes trailing commas, single quotes, unquoted keys, comments, Python True/None, cut-off brackets, and stringified JSON. Optionally validates the result against a JSON Schema (draft 4 to 2020-12) and lists each error with its location. Returns the parsed data, the JSON text, and what was changed. Not charged if no JSON can be recovered or the input is invalid. Paid via x402; see list_prices.
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": {
"text": "<text>"
},
"name": "repair_json"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | The broken JSON or LLM reply, up to 30,000 characters. | |
| schema | No | Optional JSON Schema to validate the repaired data against. |