repair_string
Deterministic repair engine. Given a raw LLM output that should contain JSON, this tool: (1) strips markdown code fences (```json), (2) regex-strips prose preambles/suffixes, (3) escapes unescaped control characters inside string values, (4) validates with json.loads — falling back to structural repairs and partial-recovery bracket closing when needed, and (5) optionally validates the repaired JSON against a JSON schema.
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": {
"raw_string": "<raw_string>"
},
"name": "repair_string"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| schema | No | Optional JSON schema. When provided, the repaired JSON is validated against it. Validation errors are translated into a list of actionable 'Fix Action' strings. | |
| api_key_id | No | Your Stripe Customer ID, used for metered billing ($1.00/mo base includes first 100 requests; $0.01 each after). | |
| raw_string | Yes | Raw text that should contain JSON. |