{"uid":"cap_2vIXpkk77euJDoi-NxeV3","slug":"alpha-stream-agentdiet-dev-deterministic-a2a-broken-json-repair-8a0f4dea","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":"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_VWo7y3jyb_cZpdQrbUney","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, malformed, or markdown-wrapped JSON strings from LLM outputs so multi-agent pipelines can continue processing without crashes.","exampleAgentPrompt":"My LLM just returned this broken JSON with trailing commas and markdown fences — can you clean it up so it parses correctly: ```{\"name\": \"Alice\", \"age\": 30,}```?","exampleUseCases":[{"title":"Fixing LLM output in agent pipeline","prompt":"The model returned this JSON with a trailing comma and it's breaking my parser — please fix it so I can pass it downstream: {\"status\": \"ok\", \"items\": [\"a\", \"b\",]}"},{"title":"Stripping markdown fences from JSON response","prompt":"I got a JSON response back from my AI wrapped in triple backtick markdown fences and my pipeline can't parse it — can you strip those out and return valid JSON?"},{"title":"Repairing single-quoted JSON from model","prompt":"My agent output this JSON using single quotes instead of double quotes and it fails JSON.parse — please convert it to valid JSON: {'user': 'bob', 'score': 42}"}],"resultDescription":"A repaired, standards-compliant JSON object reconstructed from the malformed input, with issues like trailing commas, markdown fences, single quotes, and truncation corrected so it can be parsed without errors.","failureModes":["Input JSON is too severely truncated or corrupted to deterministically repair — returns error indicating unrecoverable structure","Input string is empty or missing — returns 400-style validation error","JSON is structurally ambiguous after repair — may return best-effort result that differs from original intent","Rate limiting or payment failure via x402 micropayment protocol"],"whenToPreferThis":"Choose this endpoint when your multi-agent or LLM pipeline frequently receives malformed JSON — especially outputs with trailing commas, markdown code fences, single quotes, or truncation — and you need a deterministic, reliable fix rather than a probabilistic re-prompt. Ideal for production pipelines where crashes are costly and re-calling the LLM is slow or expensive.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-21T07:21:11.506Z","isFirstParty":false,"canonicalSlug":"alpha-stream-agentdiet-dev-deterministic-a2a-broken-json-repair-8a0f4dea"}