{"uid":"cap_S2UZto99UyLCud-9BYC5w","slug":"hn-pulse-agentdiet-dev-deterministic-a2a-broken-json-repair-schema-496a191a","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/structured-output)","url":"https://hn-pulse.agentdiet.dev/v1/structured-output?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_3tqZgwMkf1dSpSRLO7DaF","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 from my LLM has trailing commas and markdown code fences and it's breaking my pipeline — can you repair it and give me back clean, valid JSON? Here it is: ```{name: 'Alice', age: 30,}```","exampleUseCases":[{"title":"Fix LLM output in agent pipeline","prompt":"My language model just returned this malformed JSON with trailing commas and single quotes and it's crashing my downstream agent — please repair it: `{'user': 'bob', 'score': 42,}`"},{"title":"Strip markdown fences from structured output","prompt":"The AI returned JSON wrapped in triple-backtick markdown fences and my parser can't handle it — clean it up for me: ```json\n{\"status\": \"ok\", \"items\": [1, 2, 3,]}\n```"},{"title":"Recover truncated JSON from partial LLM response","prompt":"My LLM got cut off mid-response and the JSON is truncated — can you repair this so I can keep processing? Here's what I got: {\"title\": \"Report\", \"sections\": [{\"name\": \"Intro\", \"content\": \"hello"}],"resultDescription":"A repaired, valid JSON object with all syntax errors corrected — trailing commas removed, markdown fences stripped, single quotes converted to double quotes, and truncated structures closed — ready for downstream agent consumption.","failureModes":["Input is so severely malformed that deterministic repair cannot infer intent — returns error with description","Input string is empty or below minimum length — returns validation error","Ambiguous structure where repair would change semantics — may return best-effort result with warning","Payment not received or x402 flow incomplete — returns 402 Payment Required","Network timeout on high-volume requests"],"whenToPreferThis":"Choose this endpoint when your multi-agent pipeline receives JSON from an LLM that may be truncated, markdown-wrapped, or syntactically invalid and you need a deterministic (non-AI) fix that is fast and idempotent. Prefer this over asking another LLM to fix the JSON, which introduces latency and non-determinism. Ideal for production agent workflows where reliability and low cost per call ($0.002) matter.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-11-21T00:37:51.871Z","isFirstParty":false,"canonicalSlug":"hn-pulse-agentdiet-dev-deterministic-a2a-broken-json-repair-schema-e04c99ac"}