heal_json_schema
Repair malformed LLM JSON and coerce it into strict schemas by fixing syntax errors, casting types, applying defaults, and validating against target JSON Schema contracts.
Instructions
[Cost: $0.0005 USDC on Base & Solana] Universal LLM output JSON syntax healer and schema coercer.
Keywords: repair malformed json, coerce tool arguments, json repair, schema coercer, heal json, parse broken json.
Recovers broken LLM outputs: repairs malformed syntax (unquoted keys, missing brackets/quotes, trailing commas)
and casts loose parameters into strict JSON Schema contracts (fuzzy enums, type conversions, missing defaults).
Args:
content: Raw broken JSON string or dictionary produced by an LLM.
target_schema: Optional JSON Schema dictionary or string to validate and coerce against.
mode: 'auto' (syntax repair first, then schema coercion if target_schema provided),
'syntax_only' (pure syntax repair without type coercion),
'coerce_only' (pure schema type casting).
payment_signature: Optional x402 Base USDC transaction hash or developer mock key.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | auto | |
| content | Yes | ||
| target_schema | No | ||
| payment_signature | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |