Deterministic Malformed JSON Syntax & Truncation Healer
heal_malformed_jsonRepairs malformed JSON syntax by normalizing quotes, closing unclosed brackets, and fixing boolean literals into RFC 8259-compliant output without deleting data, so broken strings parse correctly.
Instructions
Deterministic JSON syntax repair: normalizes quotes, unclosed brackets, and boolean literals into compliant RFC 8259 JSON structure without data deletion. Use when fixing syntax-broken JSON strings that fail JSON.parse(); for coercing field types and verifying properties on already-parseable JSON objects against a target JSON Schema, use enforce_json_schema_types instead. Read-only edge call (32 KB, 60 RPM): accepts 'malformed_json' (with enum defaults), uses '?demo=true' or L402 (15 sats); HTTP 400 if invalid.
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": {
"malformed_json": "<malformed_json>"
},
"name": "heal_malformed_json"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| repair_mode | No | Bracket-closing and literal-normalization strategy; defaults to 'heuristic_fast' when omitted. | |
| malformed_json | Yes | Raw broken, truncated, or markdown-wrapped JSON string to repair. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| status | Yes | Repair outcome ('repaired' or 'valid_as_is'). | |
| fixes_applied | Yes | List of lexical repairs performed. | |
| parsed_object | Yes | Deserialized JSON object produced from the repaired string. | |
| repaired_json | Yes | Valid RFC 8259 JSON string after syntax healing. |