{"uid":"cap_vuowRq5RP65kNodiGis-4","slug":"whale-momentum-agentdiet-dev-deterministic-a2a-broken-json-repair-f38852d9","name":"Deterministic A2A Broken-JSON Repair & Schema Validator","description":"Repairs truncated or malformed LLM JSON outputs (trailing commas, markdown fences, single quotes) so multi-agent pipelines never crash. (Live x402 v2, IETF MPP & MCP endpoint at https://whale-momentum.agentdiet.dev/v1/repair)","url":"https://whale-momentum.agentdiet.dev/v1/repair?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"type":"object","required":["raw_json"],"properties":{"raw_json":{"type":"string","minLength":1,"description":"Malformed, truncated, or markdown-wrapped JSON string to deterministically repair"}}},"responseSchema":{"type":"object"},"example":null,"exampleRequest":null,"tags":[],"displayCostAmount":"0.002","displayCostAsset":"USD","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":"mpp","network":"tempo","amountUsd":"0.002","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"mpp","network":"tempo","amountUsd":"0.002","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_ulepnFAYrSgssjubsSABr","protocol":"mpp","methodType":"crypto","chain":"tempo","mode":"charge","costAmount":"0.002","costPer":"request","priority":0,"asset":"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":"whale-momentum.agentdiet.dev","brandSlug":"whale-momentum-agentdiet-dev-mpp","brandBaseUrl":"https://whale-momentum.agentdiet.dev","brandDocsUrl":null,"whatItDoes":"Repairs truncated or malformed LLM JSON outputs (trailing commas, markdown fences, single quotes) so multi-agent pipelines never crash","exampleAgentPrompt":"The LLM just returned this broken JSON with trailing commas and a markdown code fence — can you repair it so the pipeline doesn't crash? Here's the raw output: ```{\"name\": \"Alice\", \"age\": 30,}```","exampleUseCases":[{"title":"LLM output cleanup in agent pipeline","prompt":"My language model returned this malformed JSON with single quotes and a trailing comma — fix it so my downstream agent can parse it: {'user': 'bob', 'score': 42,}"},{"title":"Stripping markdown fences from JSON","prompt":"The AI wrapped its JSON response in a markdown code block and now my parser is choking — can you strip the fences and give me clean JSON? Here's what it returned: ```json\n{\"status\": \"ok\", \"count\": 5}\n```"},{"title":"Recovering truncated JSON from long LLM response","prompt":"My model got cut off mid-response and the JSON is truncated — it ends with just '{\"items\": [\"apple\", \"banana\"' without closing brackets. Can you repair and complete it so it's valid JSON?"}],"resultDescription":"A repaired, valid JSON object that has been cleaned of common LLM-introduced defects including trailing commas, markdown code fences, single-quote delimiters, and truncation artifacts — ready for downstream parsing and processing","failureModes":["Input JSON is so severely malformed that deterministic repair cannot infer the intended structure","raw_json parameter is empty or missing, returning a 400 validation error","JSON truncated at an ambiguous point where multiple valid completions exist","Overly large input strings may exceed query parameter length limits via GET method","Non-JSON content passed in raw_json (e.g. plain text or XML) cannot be repaired"],"whenToPreferThis":"Choose this endpoint when an LLM or agent in your pipeline produces JSON that fails standard parsers due to predictable formatting issues like trailing commas, markdown wrappers, or single quotes. It is especially valuable in automated multi-agent workflows where a JSON parse failure would cascade. Prefer this over custom regex or Python-based fixers when you need a hosted, pay-per-call solution with no infrastructure overhead.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-21T07:21:47.119Z","isFirstParty":false,"canonicalSlug":"whale-momentum-agentdiet-dev-deterministic-a2a-broken-json-repair-f38852d9"}