{"uid":"cap_Sfo585ZP_BDWID3AXX4zu","slug":"x402-audit-agentdiet-dev-deterministic-a2a-broken-json-repair-schema-1c6c6790","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://x402-audit.agentdiet.dev/v1/malformed-json-healer)","url":"https://x402-audit.agentdiet.dev/v1/malformed-json-healer?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_ixl-Fdjmi7p29wub49UJZ","protocol":"mpp","methodType":"crypto","chain":"tempo","mode":"charge","costAmount":"0.002","costPer":"request","priority":0,"asset":"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":"x402-audit.agentdiet.dev","brandSlug":"x402-audit-agentdiet-dev-mpp","brandBaseUrl":"https://x402-audit.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 LLM response came back as broken JSON with trailing commas and markdown fences — can you run it through the malformed-json-healer to fix it so my pipeline doesn't crash? Here's the raw string: ```{\"name\": \"Alice\", \"age\": 30,}```","exampleUseCases":[{"title":"Fix LLM pipeline JSON crashes","prompt":"My LLM just returned this malformed JSON with a trailing comma and it's crashing my pipeline — can you repair it? The raw string is: {\"model\": \"gpt-4\", \"tokens\": 1500,}"},{"title":"Strip markdown fences from JSON output","prompt":"The agent returned JSON wrapped in markdown code fences and my downstream parser can't handle it — can you clean it up and return valid JSON? Here's the raw output: ```json\n{\"status\": \"ok\", \"results\": [1, 2, 3]}\n```"},{"title":"Repair single-quoted JSON from LLM","prompt":"I got a JSON blob back from the model that uses single quotes instead of double quotes and it won't parse — can you fix it into valid JSON? The string is: {'user': 'bob', 'score': 42}"}],"resultDescription":"A repaired, valid JSON object that has been cleaned of common LLM-introduced errors such as trailing commas, markdown code fences, single quotes, and truncation artifacts — ready for downstream parsing without crashes.","failureModes":["JSON too severely malformed to deterministically repair (ambiguous structure)","Empty or null raw_json input","Payload exceeds length limits","Non-JSON content passed as input (e.g. plain text or XML)","Network or payment (x402) authorization failure"],"whenToPreferThis":"Choose this endpoint when your multi-agent pipeline receives raw LLM-generated JSON that may contain trailing commas, markdown fences, single quotes, or truncation artifacts and you need a deterministic (not LLM-based) fix rather than asking another LLM to reformat it. Prefer this over manual regex hacks or prompting the LLM again when reliability and idempotency across thousands of pipeline calls matter.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-21T12:51:21.346Z","isFirstParty":false,"canonicalSlug":"x402-audit-agentdiet-dev-deterministic-a2a-broken-json-repair-schema-b099d635"}