{"uid":"cap_UAgF85pG3HjBoMxjSMMKj","slug":"hn-pulse-agentdiet-dev-deterministic-a2a-broken-json-repair-schema-17d03a46","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-validator)","url":"https://hn-pulse.agentdiet.dev/v1/json-validator?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_a1SFLj30Rg2DvYIEp57l1","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, unclosed braces) so multi-agent pipelines never crash on bad JSON.","exampleAgentPrompt":"This JSON from our LLM has trailing commas and is wrapped in markdown fences — can you repair it so we can parse it without crashing? Here's the raw string: ```json {\"name\": \"Alice\", \"age\": 30,} ```","exampleUseCases":[{"title":"LLM output cleanup in agent pipeline","prompt":"Our language model returned this mangled JSON with unclosed brackets and trailing commas — fix it so the next agent in the pipeline can parse it without errors: {\"user\": \"bob\", \"score\": 42,"},{"title":"Strip markdown fences from code-block JSON","prompt":"The AI wrapped its response in a markdown code block and it's breaking our parser — strip the fences and return clean valid JSON: ```json\n{\"status\": 'ok', \"count\": 5}\n```"},{"title":"Repair single-quoted JSON from LLM","prompt":"I've got this JSON string that uses single quotes instead of double quotes and my JSON parser is rejecting it — can you convert it to valid JSON? {'product': 'widget', 'price': 9.99}"}],"resultDescription":"Returns a JSON object containing the repaired, syntactically valid JSON — with markdown fences stripped, trailing commas removed, single quotes converted to double quotes, and truncated structures closed — ready for safe programmatic parsing downstream.","failureModes":["Input JSON is so severely malformed that deterministic repair is impossible — returns an error indicating the string cannot be recovered","Empty or whitespace-only raw_json input rejected with validation error","Input exceeds maximum allowed string length","Payment not attached or insufficient for x402 micropayment — returns HTTP 402"],"whenToPreferThis":"Choose this endpoint when your multi-agent pipeline receives LLM-generated JSON that is syntactically broken and must be repaired deterministically (not re-generated) before passing to a downstream consumer. Ideal when you need idempotent, reproducible repairs rather than asking the LLM to retry, or when the truncated output cannot be regenerated cheaply. Prefer over regex hacks when handling a variety of common LLM JSON failure modes simultaneously.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-11-21T00:34:45.435Z","isFirstParty":false,"canonicalSlug":"hn-pulse-agentdiet-dev-deterministic-a2a-broken-json-repair-schema-e04c99ac"}