Repair malformed JSON from a model
fix_jsonRepair malformed JSON from LLMs by removing code fences, prose, trailing commas, smart quotes, single quotes, and unquoted keys. Returns clean parsed JSON with repairs or closest error.
Instructions
Best-effort repair of broken JSON (code fences, trailing commas, smart quotes, unquoted keys, single quotes, prose around the object, bare words). Returns the parsed value as clean JSON plus a list of the repairs applied — or, if unrepairable, the error and the closest candidate. Call this before re-asking the model.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | the raw broken JSON text |