{"uid":"cap_Xc9FYiL6dL4iQP1R1rlVR","slug":"hn-pulse-agentdiet-dev-deterministic-a2a-broken-json-repair-schema-f9e4784b","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://hn-pulse.agentdiet.dev/v1/json-repair)","url":"https://hn-pulse.agentdiet.dev/v1/json-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_BvMqRX8urDzA1QRN64pAk","protocol":"mpp","methodType":"crypto","chain":"tempo","mode":"charge","costAmount":"0.002","costPer":"request","priority":0,"asset":"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":"hn-pulse.agentdiet.dev","brandSlug":"hn-pulse-agentdiet-dev-mpp","brandBaseUrl":"https://hn-pulse.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 is broken — it has trailing commas, single quotes, and a markdown code fence wrapper — can you repair it into valid parseable JSON? Here it is: ```json {'name': 'Alice', 'age': 30,}```","exampleUseCases":[{"title":"Fix LLM output in agent pipeline","prompt":"The language model just returned this JSON but it has trailing commas and single quotes making it unparseable — repair it so the next step in my pipeline can use it: {'items': ['apple', 'banana',], 'count': 2,}"},{"title":"Strip markdown fences from JSON","prompt":"My coding agent wrapped its JSON response in a markdown code block and now my parser is crashing — clean it up and give me the raw valid JSON: ```json {\"status\": \"ok\", \"data\": [1, 2, 3],} ```"},{"title":"Recover truncated API response","prompt":"I got a truncated JSON response from an LLM call that got cut off mid-string — try to repair and complete it so I can extract the fields I need: {\"title\": \"How to build agents\", \"summary\": \"This guide covers the basics of"}],"resultDescription":"A repaired, valid JSON object parsed from the malformed input string, with all syntax errors corrected — trailing commas removed, markdown fences stripped, single quotes normalized to double quotes, and truncated structures closed — ready for downstream consumption by agent pipelines.","failureModes":["Input JSON is so severely truncated or corrupted that deterministic repair is impossible","Input string contains no JSON-like structure at all","Ambiguous structure where multiple valid repairs exist and heuristics cannot disambiguate","Payload exceeds size limits","Missing required raw_json field returns 422 validation error"],"whenToPreferThis":"Choose this endpoint when your multi-agent pipeline receives LLM-generated JSON that fails standard JSON.parse() due to common LLM formatting artifacts like trailing commas, single quotes, or markdown code fences. It is especially valuable in autonomous A2A workflows where crashing on bad JSON would break the entire pipeline. Prefer this over custom regex hacks or manual parsing when you need a reliable, deterministic, pay-per-call microservice without standing up your own infrastructure.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-11-21T00:32:40.757Z","isFirstParty":false,"canonicalSlug":"hn-pulse-agentdiet-dev-deterministic-a2a-broken-json-repair-schema-e04c99ac"}