{"uid":"cap_Cxw4UtF-EDq7LCUbCSFdK","slug":"agentdiet-json-fix-malformed-json-repair-api-dc84c984","name":"AgentDiet JSON Fix - Malformed JSON Repair API","description":"Deterministic B2A/A2A/MCP/x402/MPP/L402 execution and intelligence node at https://mcp-gateway.agentdiet.dev settling in USDC on Base.","url":"https://mcp-gateway.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_ouJvz0GABDr1l46mLFPyN","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 raw malformed or broken JSON as a query parameter and returns a cleaned, valid JSON object with compression metadata.","exampleAgentPrompt":"I have this broken JSON string that won't parse — can you fix it and return valid JSON? Here it is: {name: 'Alice', age: 30, hobbies: ['reading', 'coding'} — it's missing a closing bracket.","exampleUseCases":[{"title":"Repair LLM-generated malformed JSON","prompt":"The language model just gave me back this broken JSON and I need it fixed before I can process it: {\"user\":\"bob\",\"score\":42,\"tags\":[\"vip\",\"active\"} — the array isn't closed properly. Can you clean it up?"},{"title":"Fix API response with syntax errors","prompt":"I'm getting a JSON parse error from a third-party API — the response looks like: {status: ok, data: {count: 5, items: ['a','b','c']} — can you repair it so it's valid JSON I can work with?"},{"title":"Normalize LLM output for downstream processing","prompt":"I have some JSON output from an AI pipeline that has trailing commas and unquoted keys — something like {name: John, scores: [1,2,3,],} — please fix it so I can pass it to the next step in my workflow."}],"resultDescription":"A JSON response containing a 'data' field with the corrected/cleaned JSON object, a 'status' field indicating success (e.g. 'ok'), and a 'roi_proof' object showing the compression_ratio_pct achieved during repair (e.g. 91.4%).","failureModes":["Input is so malformed it cannot be heuristically repaired — returns error or empty data object","Missing required 'input' field or 'method' field causes schema validation failure","Extremely large JSON strings may hit size limits or timeout","Non-JSON text passed as raw_json may return unexpected results or error"],"whenToPreferThis":"Use this endpoint when you have a malformed, broken, or syntactically invalid JSON string that needs to be repaired and returned as a valid parseable JSON object, particularly in automated agent pipelines where LLM outputs or third-party API responses frequently contain JSON syntax errors. Prefer this over manual parsing logic when you need a quick, pay-per-use fix with no infrastructure overhead, paid in USDC micro-transactions via x402.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-22T12:43:14.922Z","isFirstParty":false,"canonicalSlug":"agentdiet-json-fix-malformed-json-repair-api-dc84c984"}