Convert broken JSON to valid JSON and check it on a schema
json_repairRepairs broken JSON: markdown fences, comments, trailing commas, single quotes, unquoted keys, Python literals (True, False, None) and truncated endings. Pure code first; the model is asked once only when code cannot repair it. Optional JSON Schema check covers type, required, properties, items, enum, minimum, maximum, minLength, maxLength and pattern. Input max 1 MB. Related tools on this server, for a different need: json_validate when you need to check JSON data against a JSON Schema. Price: $0.002 per successful call, paid with x402 (USDC on Base, Solana and 10 more networks); failed calls are not charged.
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": "json_repair"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | The broken JSON text (max 1 MB) | |
| schema | No | Optional JSON Schema to validate the repaired value against |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fixes | No | ||
| valid | No | ||
| value | No | ||
| problems | No | ||
| checkedAt | No | ||
| usedModel | No |