{"uid":"cap_mCM33yeZzlxTu591Fm3Xv","slug":"token-intel-agentdiet-dev-deterministic-a2a-broken-json-repair-schema-12f4b582","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/repair)","url":"https://token-intel.agentdiet.dev/v1/repair?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_GcioGlEXNqJQaLePJVvdF","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) into valid JSON so multi-agent pipelines don't crash","exampleAgentPrompt":"This LLM output came back as broken JSON with trailing commas and markdown fences — can you repair it so I can parse it? Here's the raw string: ```{\"name\": \"Alice\", \"score\": 42,}```","exampleUseCases":[{"title":"Fix LLM output before pipeline step","prompt":"The language model just returned this JSON with a trailing comma and it's breaking my downstream agent — can you repair it so it's valid? Here's the raw output: {\"result\": \"success\", \"items\": [1, 2, 3,]}"},{"title":"Strip markdown fences from agent response","prompt":"My agent returned JSON wrapped in triple backticks and now my parser is crashing — can you strip the markdown fencing and fix it so I get clean, valid JSON back? Raw string: ```json\n{\"status\": \"ok\", \"value\": 99}\n```"},{"title":"Recover truncated JSON from crashed run","prompt":"A long-running LLM call got cut off mid-response and now I have a truncated JSON object that won't parse — can you repair it and give me back whatever valid structure you can recover? Here it is: {\"user\": \"bob\", \"data\": {\"score\": 87"}],"resultDescription":"A repaired, valid JSON object reconstructed from the malformed input, with fixes applied for issues like trailing commas, single quotes, markdown fences, and truncation. The response schema is a generic JSON object containing the corrected structure.","failureModes":["Input is so severely malformed that deterministic repair is impossible — returns an error or best-effort partial result","Input is not JSON at all (e.g. plain text or binary) — unclear how the endpoint handles non-JSON input","Very long truncated strings may result in semantically incorrect repairs if the intent of the missing content cannot be inferred","Query parameter URL-encoding issues if the raw JSON contains special characters and is not properly encoded before submission"],"whenToPreferThis":"Choose this endpoint when an AI agent or multi-agent pipeline receives malformed, truncated, or markdown-wrapped JSON from an LLM and needs a deterministic, rule-based repair rather than an LLM re-generation. Ideal for production pipelines where reliability matters and re-calling the LLM is expensive or slow. Prefer this over manual string manipulation when the JSON has multiple simultaneous issues (trailing commas + fences + single quotes).","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-21T07:23:10.382Z","isFirstParty":false,"canonicalSlug":"token-intel-agentdiet-dev-deterministic-a2a-broken-json-repair-schema-12f4b582"}