{"uid":"cap_xzbzGqATIPsRHvAkBg21D","slug":"agentdiet-json-repair-b098bd61","name":"AgentDiet JSON Repair","description":"Deterministic B2A/A2A/MCP/x402/MPP/L402 execution and intelligence node at https://rag-diet.agentdiet.dev settling in USDC on Base.","url":"https://rag-diet.agentdiet.dev/v1/json-repair?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method"],"properties":{"type":{"type":"string","const":"http"},"method":{"enum":["GET","POST"],"type":"string"},"queryParams":{"type":"object","properties":{"raw_json":{"type":"string"}}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object"}}}}},"responseSchema":{"type":"json","example":{"data":{},"status":"ok","roi_proof":{"compression_ratio_pct":91.4}}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.002","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.002/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm__9tbr-cbptunBQInxvDIE","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.002","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Repairs and cleans malformed JSON strings, returning valid, well-formed JSON with a compression ratio proof.","exampleAgentPrompt":"Can you fix this broken JSON for me? It keeps throwing parse errors — here's the raw string: {\"name\": \"Alice\", \"age\": 30, \"city\": \"New York\",.}","exampleUseCases":[{"title":"Repair LLM-generated malformed JSON","prompt":"The AI just returned some JSON but it's broken — there are trailing commas and mismatched brackets. Can you repair it so I can actually use it? Here's the raw string: {\"items\": [\"apple\", \"banana\",], \"count\": 2,}"},{"title":"Salvage corrupted API response data","prompt":"I got a truncated JSON response from an external API and I need to recover whatever valid data is in there. Can you fix and clean up this malformed JSON: {\"user_id\": 42, \"status\": \"active\", \"meta\": {\"plan\": \"pro\""},{"title":"Clean JSON before database ingestion","prompt":"Before I store this in the database, can you repair this JSON that came in from the webhook? It has some syntax errors I need cleaned up: {\"event\": \"purchase\", \"amount\": 49.99 \"currency\": \"USD\", \"timestamp\": \"2024-01-15\"}"}],"resultDescription":"Returns a JSON object with a 'data' field containing the repaired, valid JSON, a 'status' field (e.g. 'ok'), and an 'roi_proof' object showing the compression_ratio_pct (e.g. 91.4%) achieved during repair and cleaning.","failureModes":["Input JSON is so corrupted that no valid structure can be inferred — returns an error status","Missing required 'raw_json' query parameter — request rejected","Input is not JSON at all (e.g. plain text or binary) — may return empty or error response","Payment not settled in USDC on Base — x402 payment required before processing"],"whenToPreferThis":"Choose this endpoint when you need deterministic, programmatic JSON repair rather than asking an LLM to reformat JSON (which is non-deterministic and wastes tokens). Ideal for agent pipelines that receive JSON from external APIs, webhooks, or other LLMs and need reliable parsing before downstream processing. The compression ratio proof also makes it useful when you want to verify how much bloat was removed.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-22T12:43:56.013Z","isFirstParty":false,"canonicalSlug":"agentdiet-json-repair-b098bd61"}