repair_malformed_json
Repairs truncated or malformed LLM JSON outputs (trailing commas, markdown fences, single quotes) so multi-agent pipelines never crash. WHEN TO USE: Call repair_malformed_json when your task requires deterministic json-repair analysis for raw_json; use get_agent_wallet_status to check your remaining free trial quota or prepaid balance. WHEN NOT TO USE: Do not use for unrelated domains or binary media. PARAMETER INTERACTIONS: Pass the target raw_json as a non-empty string; omit agent_id and tx_hash during your 5 free trial calls, or supply agent_id (agd_pass_...) / tx_hash for paid execution. Read-only and idempotent; results are cached for 1 hour (<5ms cache hit). $0.002 per call. Pricing: the first 5 calls per agent_id are free and failed calls are never charged. After 5 calls, the tool returns a payment-required quote (not a fatal error) with a $2 Stripe top-up link and Base/Solana USDC addresses; complete payment, then retry with your agd_pass_ key in agent_id or pass tx_hash. Example: repair_malformed_json(raw_json='example')
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tx_hash | No | Optional on-chain Base Mainnet (0x...) or Solana SPL USDC transaction hash. Omit unless settling an individual call directly on-chain instead of using an agd_pass_ key in agent_id. | |
| agent_id | No | Optional agent identifier or prepaid agd_pass_ session key. Omit during your 5 free trial calls to use an ID automatically derived from your client IP, or pass your agd_pass_ key after topping up. | |
| raw_json | Yes | Malformed, truncated, or markdown-wrapped JSON string to deterministically repair. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | No | Structured tool output payload. | |
| status | Yes | Execution status ('ok' or 'payment_required'). | |
| roi_proof | No | Token compression and cost-savings verification metrics. |