{"uid":"cap_P_IxikuAV1H1b-YtYGk_0","slug":"whale-momentum-agentdiet-dev-deterministic-a2a-broken-json-repair-c4378aaf","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":"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_z8jkfLv14Urq_C7vecwJe","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 from the LLM has trailing commas and is wrapped in markdown fences — can you repair it so it's valid and parseable: ```{\"name\": \"Alice\", \"age\": 30,}```?","exampleUseCases":[{"title":"Fix crashed agent pipeline JSON","prompt":"My agent pipeline just broke because the upstream LLM returned malformed JSON with trailing commas and single quotes — can you repair this string so I can continue processing: {'user': 'bob', 'score': 42,}"},{"title":"Strip markdown fences from LLM output","prompt":"The model returned its JSON wrapped in triple backtick markdown fences and now my parser is failing — please clean and repair this so it's raw valid JSON: ```json\n{\"status\": \"ok\", \"items\": [1, 2, 3,]}\n```"},{"title":"Recover truncated JSON response","prompt":"I got a truncated JSON response from an LLM that cuts off mid-string — something like {\"title\": \"Hello\", \"body\": \"This is a long — can you deterministically repair it so it closes properly and is valid JSON?"}],"resultDescription":"A repaired, valid JSON object derived from the input malformed string, with all syntax errors corrected including trailing commas removed, markdown fences stripped, single quotes converted to double quotes, and truncated structures closed.","failureModes":["Input is so severely malformed it cannot be deterministically repaired — returns error or best-effort partial output","Input is not JSON-like at all (e.g. plain prose) — endpoint may fail or return an unstructured result","Extremely long or nested truncated JSON may be ambiguously repairable — output may differ from original intent","GET method with long raw_json parameter may hit URL length limits for very large JSON strings"],"whenToPreferThis":"Choose this endpoint when your multi-agent pipeline receives LLM-generated JSON that fails parsing due to common syntax errors like trailing commas, markdown code fences, single-quoted keys, or truncation. It is especially valuable as a middleware step between an LLM output stage and any downstream JSON consumer that requires strict validity. Prefer it over ad-hoc regex fixes when you need deterministic, reliable repair without writing custom parsing logic.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-21T07:20:25.851Z","isFirstParty":false,"canonicalSlug":"whale-momentum-agentdiet-dev-deterministic-a2a-broken-json-repair-f38852d9"}