{"uid":"cap_0YG7LQd_fJmm9xEkAw83d","slug":"x402-audit-agentdiet-dev-deterministic-a2a-broken-json-repair-schema-f53d7410","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/json-fix)","url":"https://x402-audit.agentdiet.dev/v1/json-fix?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_62K5U_mrOE87DMc0OCLh4","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 JSON from the LLM is broken — it has trailing commas and markdown code fences around it. Can you fix it so it parses correctly: ```{\"name\": \"Alice\", \"age\": 30,}```?","exampleUseCases":[{"title":"Fix LLM output in agent pipeline","prompt":"The language model returned JSON with single quotes and a trailing comma that's breaking my pipeline. Can you repair this string so it's valid JSON: {'user': 'bob', 'score': 95,}"},{"title":"Strip markdown fences from JSON","prompt":"My LLM wrapped its JSON response in triple-backtick markdown fences and now my parser is crashing. Please fix this: ```json\n{\"status\": \"ok\", \"result\": 42}\n```"},{"title":"Recover truncated JSON response","prompt":"The model's response got cut off mid-JSON and now it won't parse. Can you repair this truncated string and return valid JSON: {\"items\": [\"apple\", \"banana\", \"ch"}],"resultDescription":"A repaired, valid JSON object reconstructed from the malformed input. The response includes the corrected JSON structure with all fixable issues resolved — such as removed markdown fences, replaced single quotes with double quotes, stripped trailing commas, and completed truncated structures where deterministically inferable.","failureModes":["Input JSON too ambiguous or severely malformed to deterministically repair — returns error or best-effort output","Payment failure via x402 protocol — returns HTTP 402 if USDC micropayment not provided","Empty or missing raw_json parameter — returns validation error","Input exceeds maximum length limits — returns size error","JSON corruption so severe that structure cannot be inferred — may return partial or failed repair"],"whenToPreferThis":"Choose this endpoint when your multi-agent or LLM pipeline receives JSON that fails to parse due to common LLM output artifacts — trailing commas, markdown code fences, single quotes, or truncation. It is deterministic (not AI-based), so it produces consistent, predictable repairs suitable for production pipelines. Prefer it over ad-hoc regex fixes or asking a second LLM to reformat the JSON, especially when reliability and cost ($0.002/call) matter more than flexibility.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-21T12:51:30.652Z","isFirstParty":false,"canonicalSlug":"x402-audit-agentdiet-dev-deterministic-a2a-broken-json-repair-schema-b099d635"}