{"uid":"cap_7NcFHqT_zLvQ-nmcYy2JM","slug":"alpha-stream-agentdiet-dev-deterministic-a2a-broken-json-repair-1a76de4b","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://alpha-stream.agentdiet.dev/v1/malformed-json-healer)","url":"https://alpha-stream.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__-1BALayXnLVkF_HZlpSl","protocol":"mpp","methodType":"crypto","chain":"tempo","mode":"charge","costAmount":"0.002","costPer":"request","priority":0,"asset":"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":"alpha-stream.agentdiet.dev","brandSlug":"alpha-stream-agentdiet-dev-mpp","brandBaseUrl":"https://alpha-stream.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 LLM response came back with broken JSON — it has a trailing comma, single quotes instead of double quotes, and a markdown code fence around it. Can you fix it so it's valid JSON I can parse? Here's the raw string: ```{'name': 'Alice', 'age': 30,}```","exampleUseCases":[{"title":"Fix LLM output before pipeline ingestion","prompt":"My language model returned this JSON but it's wrapped in a markdown code block and has trailing commas — can you repair it so I can pass it into the next step of my pipeline? Here it is: ```json\n{\"items\": [\"apple\", \"banana\",],\n\"count\": 2,\n}```"},{"title":"Recover truncated agent response JSON","prompt":"The agent response got cut off mid-JSON and now it won't parse. Can you deterministically repair this truncated JSON string and return a valid object? The raw string is: {\"user\": \"bob\", \"score\": 42, \"tags\": [\"vip\","},{"title":"Sanitize single-quoted JSON from scraping step","prompt":"I scraped some data and the JSON came back using single quotes instead of double quotes — Python dict style. Can you convert it to valid JSON? Here's the raw string: {'product': 'widget', 'price': 9.99, 'available': True}"}],"resultDescription":"A repaired, valid JSON object reconstructed from the malformed input. The response contains the corrected JSON with all syntax errors resolved — trailing commas removed, markdown fences stripped, single quotes converted to double quotes, and truncated structures closed — ready for downstream parsing without errors.","failureModes":["Input is so severely malformed that deterministic repair is impossible — returns an error indicating the string cannot be salvaged","Input is not JSON at all (plain text, binary data) — may return an error or empty object","Truncation occurs mid-value in an ambiguous way that makes correct reconstruction impossible","Network or payment errors (HTTP 402 if payment not provided, 5xx for server errors)","Extremely long or deeply nested JSON may time out"],"whenToPreferThis":"Choose this endpoint when your multi-agent or LLM pipeline receives JSON outputs that fail standard JSON.parse() calls due to common LLM formatting artifacts — trailing commas, markdown code fences, Python-style single quotes, or response truncation. It is particularly valuable in automated pipelines where a crashed parser would halt the entire workflow. Prefer it over custom regex-based cleanup when you need deterministic, reliable repair without maintaining your own sanitization logic.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-11-21T12:35:23.508Z","isFirstParty":false,"canonicalSlug":"alpha-stream-agentdiet-dev-deterministic-a2a-broken-json-repair-8a0f4dea"}