{"uid":"cap_q_90ZQQvwqHF995jXnagi","slug":"token-intel-agentdiet-dev-deterministic-a2a-broken-json-repair-schema-1adf4a06","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://token-intel.agentdiet.dev/v1/json-fix)","url":"https://token-intel.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_50qqOZDL4Dn9Tj2q1dNGu","protocol":"mpp","methodType":"crypto","chain":"tempo","mode":"charge","costAmount":"0.002","costPer":"request","priority":0,"asset":"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":"token-intel.agentdiet.dev","brandSlug":"token-intel-agentdiet-dev-mpp","brandBaseUrl":"https://token-intel.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":"The LLM just returned this broken JSON with trailing commas and markdown fences — can you fix it so I can parse it: ```{\"name\": \"Alice\", \"age\": 30,}```?","exampleUseCases":[{"title":"Fixing LLM pipeline JSON crashes","prompt":"My agent pipeline keeps crashing because the model keeps returning JSON wrapped in markdown code blocks with trailing commas. Can you repair this so it parses cleanly: ```{\"status\": \"ok\", \"items\": [1, 2, 3,],}```?"},{"title":"Repairing truncated AI-generated JSON","prompt":"The model cut off mid-response and gave me this truncated JSON: {\"user\": \"bob\", \"score\": 95, \"tags\": [\"vip\" — can you deterministically repair it into valid JSON?"},{"title":"Normalizing single-quoted JSON from agent output","prompt":"One of my agents returned JSON using single quotes instead of double quotes, like {'name': 'Alice', 'role': 'admin'} — can you fix that into proper valid JSON?"}],"resultDescription":"Returns a repaired, valid JSON object with malformed syntax corrected — trailing commas removed, markdown fences stripped, single quotes converted to double quotes, and truncated structures closed — ready for direct parsing by downstream agents or applications.","failureModes":["JSON too severely malformed to deterministically repair — returns error indicating unrecoverable input","Empty or missing raw_json parameter — returns 400 validation error","Input is already valid JSON — may return as-is or confirm validity","Extremely long or deeply nested JSON may hit processing limits"],"whenToPreferThis":"Choose this endpoint when your multi-agent pipeline receives LLM-generated JSON that fails standard JSON.parse() due to common model errors like trailing commas, markdown code fences, single quotes, or truncation. Prefer this over writing custom regex fixers or prompt-engineering the model to output clean JSON — it provides deterministic, rule-based repair rather than probabilistic re-generation. Ideal for production agent pipelines where reliability matters more than round-tripping to the LLM.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-21T07:25:38.635Z","isFirstParty":false,"canonicalSlug":"token-intel-agentdiet-dev-deterministic-a2a-broken-json-repair-schema-12f4b582"}