{"uid":"cap_YPaw6WOmjJbbtD0aSBg4G","slug":"alpha-stream-agentdiet-dev-deterministic-a2a-broken-json-repair-d725c4b3","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/repair)","url":"https://alpha-stream.agentdiet.dev/v1/repair?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_iRp2N5eev0cKCsCfREz9O","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-generated JSON (trailing commas, markdown fences, single quotes, truncations) so multi-agent pipelines can process outputs without crashing","exampleAgentPrompt":"This LLM output came back as broken JSON with trailing commas and a markdown code fence — can you repair it so I can pass it downstream? Here's the raw string: ```{\"name\": \"Alice\", \"score\": 42,}```","exampleUseCases":[{"title":"Fix LLM response in agent pipeline","prompt":"My language model just returned a JSON blob with trailing commas and single quotes and my pipeline is crashing — repair this for me: {'name': 'Bob', 'items': ['a', 'b',]}"},{"title":"Strip markdown fences from model output","prompt":"The model wrapped its JSON in triple-backtick markdown fences and now my parser rejects it. Can you clean this up: ```json\n{\"status\": \"ok\", \"count\": 5}\n```"},{"title":"Recover truncated JSON from incomplete generation","prompt":"My LLM hit its token limit and returned a truncated JSON object that cuts off mid-structure. Try to repair it so I can extract whatever data is usable: {\"users\": [{\"id\": 1, \"name\": \"Alice\"}, {\"id\": 2, \"name\":"}],"resultDescription":"A repaired, valid JSON object reconstructed from the malformed input, with structural issues (trailing commas, markdown fences, single quotes, truncations) corrected so the output can be safely parsed and passed to downstream agents or systems","failureModes":["Input is so severely malformed or truncated that deterministic repair cannot recover a valid structure","Input string is empty or does not resemble JSON at all","Ambiguous truncation points where multiple valid completions exist","Payment not processed (HTTP 402) if x402 micropayment fails"],"whenToPreferThis":"Choose this endpoint when your multi-agent pipeline receives LLM-generated JSON that fails standard JSON.parse() due to common issues like trailing commas, markdown fences, single quotes, or token-limit truncations. Ideal for AI orchestration layers that need deterministic, rule-based repair rather than a probabilistic LLM re-generation. Prefer this over asking an LLM to re-generate or fix JSON when you need low-latency, low-cost, reproducible results at $0.002 per call.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-11-21T00:33:28.726Z","isFirstParty":false,"canonicalSlug":"alpha-stream-agentdiet-dev-deterministic-a2a-broken-json-repair-8a0f4dea"}