{"uid":"cap_miQajglorcHsCOVcGkCKz","slug":"hn-pulse-agentdiet-dev-deterministic-a2a-broken-json-repair-schema-e04c99ac","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/repair)","url":"https://hn-pulse.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_OhCNT1ZCjsLhvTj71b_kZ","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 malformed, truncated, or markdown-wrapped LLM JSON outputs (trailing commas, single quotes, markdown fences) so multi-agent pipelines never crash on bad JSON.","exampleAgentPrompt":"I just got this JSON back from the LLM but it has trailing commas and markdown fences and won't parse — can you run it through the JSON repair endpoint to fix it? Here's the raw string: ```{\"name\": \"Alice\", \"score\": 42,}```","exampleUseCases":[{"title":"Fix LLM output before pipeline step","prompt":"The model returned this JSON with a trailing comma and single quotes and now my pipeline is crashing — fix this for me: {'user': 'bob', 'items': ['a', 'b',]}"},{"title":"Strip markdown fences from agent response","prompt":"My agent wrapped its JSON output in triple backticks and now the next step can't parse it — can you clean it up and give me valid JSON? Here's what it returned: ```json\n{\"status\": \"ok\", \"count\": 5}\n```"},{"title":"Recover truncated JSON from interrupted generation","prompt":"The model got cut off mid-response and I ended up with this truncated JSON: {\"results\": [{\"id\": 1, \"name\": \"foo\"}, {\"id\": 2 — can you repair it so I can use it?"}],"resultDescription":"A repaired, valid JSON object that has been cleaned of common LLM-induced malformations such as trailing commas, single quotes, markdown code fences, and truncation artifacts, ready to be used downstream in an agent pipeline without further sanitization.","failureModes":["Input JSON is so severely malformed that deterministic repair is impossible — returns error","Input string is empty or missing raw_json parameter — returns 400 validation error","JSON is structurally ambiguous after truncation and cannot be unambiguously completed — may return partial repair or error","Payment not processed or x402 header missing — returns 402 Payment Required"],"whenToPreferThis":"Choose this endpoint when your multi-agent pipeline receives raw LLM-generated JSON that is not guaranteed to be valid — especially when outputs may be truncated, wrapped in markdown code fences, use single quotes, or contain trailing commas. Prefer this over custom regex sanitization when you need a deterministic, consistent repair pass before passing JSON to a downstream agent or schema validator.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-21T07:20:56.434Z","isFirstParty":false,"canonicalSlug":"hn-pulse-agentdiet-dev-deterministic-a2a-broken-json-repair-schema-e04c99ac"}