{"uid":"cap_PdxXJ__5pc89W-AcDC4Di","slug":"whale-momentum-agentdiet-dev-deterministic-a2a-broken-json-repair-498a5b96","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/malformed-json-healer)","url":"https://whale-momentum.agentdiet.dev/v1/malformed-json-healer?utm_source=zero.xyz","method":"POST","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_m2L6MFUO8l4uheJScAVlo","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":"This JSON string I got back from the LLM is broken — it has trailing commas and markdown fences around it. Can you repair it so it's valid JSON I can actually use? Here it is: ```{\"name\": \"Alice\", \"age\": 30,}```","exampleUseCases":[{"title":"Fix LLM output in agent pipeline","prompt":"The last step in my pipeline returned this malformed JSON with trailing commas and it's crashing my next agent — can you repair it? Here's the bad output: {\"status\": \"ok\", \"items\": [1, 2, 3,], \"meta\": {\"count\": 3,}}"},{"title":"Strip markdown fences from JSON response","prompt":"My AI assistant wrapped its JSON response in markdown code fences and now my parser is choking on it. Can you clean it up and give me valid JSON? The raw string is: ```json\n{\"result\": \"success\", \"data\": [1, 2]}\n```"},{"title":"Repair single-quoted JSON from chatbot output","prompt":"I'm getting JSON back from a chatbot that uses single quotes instead of double quotes and it's not parsing. Fix this so it's valid JSON: {'user': 'bob', 'score': 42, 'active': true}"}],"resultDescription":"A JSON object containing the repaired, schema-valid version of the input malformed JSON string, suitable for direct consumption by downstream agents or parsers without further sanitization.","failureModes":["Input is so severely corrupted that deterministic repair is impossible — returns error with reason","Non-JSON content passed (e.g. plain prose) — cannot be repaired","Idempotency-Key collision with differing input — may return cached prior result","Payment failure via x402 — HTTP 402 response before processing occurs","Input exceeds size limits — returns 4xx with size constraint message"],"whenToPreferThis":"Choose this endpoint when your multi-agent pipeline receives LLM-generated JSON that fails standard parsers due to common LLM formatting errors like trailing commas, markdown code fences, single quotes, or truncation. Ideal as a middleware step between LLM output and any downstream JSON consumer. Prefer over custom repair logic when you need a deterministic, pay-per-call solution without maintaining your own JSON healing code.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-23T06:32:14.218Z","isFirstParty":false,"canonicalSlug":"whale-momentum-agentdiet-dev-deterministic-a2a-broken-json-repair-f38852d9"}