{"uid":"cap_hwvZNGO-zEbBsfZPp5NTH","slug":"agentdiet-json-fix-malformed-json-repair-validation-774d919d","name":"AgentDiet JSON Fix — Malformed JSON Repair & Validation","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-fix?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_F8HeJRIvNN19xWP35Uz17","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":"Accepts malformed or broken JSON via query parameter and returns a corrected, valid JSON object with a compression ratio proof.","exampleAgentPrompt":"Can you fix this broken JSON for me? It keeps failing to parse: {name: 'Alice', age: 30, hobbies: ['reading', 'coding'} — just return the corrected valid JSON.","exampleUseCases":[{"title":"Repair LLM-generated malformed JSON","prompt":"My language model returned this JSON but it's broken and won't parse: {\"user\":\"bob\",\"score\":42,\"tags\":[\"vip\",\"active\"} — can you fix it so I can use it downstream?"},{"title":"Sanitize JSON before database ingestion","prompt":"I have this JSON payload from an external API that has syntax errors and I need it corrected before I insert it into my database: {id: 1, status: 'active', meta: {created: '2024-01-01'} — please return valid JSON."},{"title":"Validate agent tool call output","prompt":"An agent tool returned what looks like JSON but it's malformed — can you run it through the JSON fixer and give me back a clean, parseable version? Here's the raw output: {\"result\":true,\"items\":[1,2,3,}"}],"resultDescription":"Returns a JSON object containing a 'data' field with the repaired JSON, a 'status' field indicating success ('ok'), and an 'roi_proof' object showing the compression_ratio_pct achieved during fixing (e.g. 91.4%).","failureModes":["Input JSON is so malformed it cannot be inferred — returns error status","Missing required 'raw_json' query parameter — request rejected","Input is not JSON-like at all (e.g. plain text or binary) — unparseable","Network or payment failure via x402/USDC on Base — 402 response requiring payment"],"whenToPreferThis":"Choose this endpoint when you need a fast, deterministic, pay-per-call JSON repair service with cryptographic payment settlement on Base in USDC. It is ideal for AI agent pipelines where LLM-generated or third-party JSON outputs are frequently malformed and need programmatic fixing before downstream processing. Prefer it over manual parsing heuristics when you want a reliable, auditable fix with a compression ratio proof returned alongside the corrected data.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-22T12:44:22.742Z","isFirstParty":false,"canonicalSlug":"agentdiet-json-fix-malformed-json-repair-validation-774d919d"}