{"uid":"cap__-FclnsBxto9azZqheDhd","slug":"alpha-stream-agentdiet-dev-deterministic-a2a-broken-json-repair-fe999f4b","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/json-fix)","url":"https://alpha-stream.agentdiet.dev/v1/json-fix?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_CJVJ3RH9vZwhyVx3SQE_y","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 malformed, truncated, or markdown-wrapped JSON strings (trailing commas, single quotes, fences) into valid JSON for use in multi-agent pipelines.","exampleAgentPrompt":"The JSON I got back from the LLM is broken — it has trailing commas and markdown fences around it. Can you fix it so it parses correctly? Here's the raw output: ```{\"name\": \"Alice\", \"age\": 30,}```","exampleUseCases":[{"title":"Fixing broken LLM pipeline output","prompt":"My agent pipeline just crashed because the model returned JSON with a trailing comma and it won't parse — can you repair this so it's valid: {\"status\": \"ok\", \"items\": [1, 2, 3,]}?"},{"title":"Cleaning markdown-wrapped JSON from chat model","prompt":"The chat model wrapped its JSON answer in triple backticks and used single quotes instead of double quotes. Can you strip the fences and fix the quoting so I get valid JSON back? Here it is: ```{'user': 'bob', 'score': 42}```"},{"title":"Recovering truncated JSON from streaming response","prompt":"I got a streaming response that got cut off mid-JSON and now it won't parse. Can you try to repair and complete it? The raw string is: {\"results\": [{\"id\": 1, \"value\": \"foo\"}, {\"id\": 2"}],"resultDescription":"A JSON object containing the repaired, syntactically valid version of the input string, suitable for immediate parsing and use in downstream agent steps or data pipelines.","failureModes":["Input JSON is so severely corrupted that deterministic repair is impossible — returns error indicating unrecoverable structure","Empty or whitespace-only raw_json input — returns validation error","Input is not JSON at all (e.g. plain prose) — may return error or best-effort object","Payment not included or insufficient — returns HTTP 402 requiring x402 micropayment","Network timeout on large or deeply nested inputs"],"whenToPreferThis":"Choose this endpoint when your multi-agent pipeline receives LLM-generated JSON that fails to parse due to common formatting errors like trailing commas, markdown fences, single quotes, or truncation. It is deterministic (not LLM-based), making it fast, predictable, and safe to call in tight retry loops. Prefer it over prompt-engineering retries when you need reliable, low-latency JSON sanitization at $0.002/call without burning additional LLM tokens.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-11-21T12:40:02.281Z","isFirstParty":false,"canonicalSlug":"alpha-stream-agentdiet-dev-deterministic-a2a-broken-json-repair-8a0f4dea"}