{"uid":"cap_aEAwtUgKz7RuFwc_C1Vne","slug":"token-intel-agentdiet-dev-deterministic-a2a-broken-json-repair-schema-e9720921","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-validator)","url":"https://token-intel.agentdiet.dev/v1/json-validator?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_SYScYG6cnCdfIFJf62PVz","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 malformed, truncated, or markdown-wrapped JSON strings (trailing commas, single quotes, markdown fences) so multi-agent pipelines can process valid JSON reliably.","exampleAgentPrompt":"This JSON string came back from the LLM with trailing commas and markdown fences wrapping it — can you run it through the JSON repair tool and give me back clean, valid JSON? Here's the raw output: ```{\"name\": \"Alice\", \"score\": 95,}```","exampleUseCases":[{"title":"LLM pipeline crash prevention","prompt":"My agent just got back this malformed JSON from the language model — it has trailing commas and it's wrapped in markdown backticks. Can you fix it so the next step in my pipeline doesn't crash? Here's the raw string: ```{\"user\": \"bob\", \"items\": [1, 2, 3,],}```"},{"title":"Single-quote JSON normalization","prompt":"I got a JSON blob from an older Python script that used single quotes instead of double quotes — something like {'key': 'value', 'count': 42}. Can you repair it into valid JSON so I can parse it properly?"},{"title":"Truncated AI response recovery","prompt":"The LLM response got cut off mid-JSON and I ended up with something like {\"results\": [{\"id\": 1, \"name\": \"foo\". Can you run this through the JSON repair endpoint and recover as much valid structure as possible?"}],"resultDescription":"Returns a JSON object containing the repaired, valid JSON string reconstructed from the malformed input, with syntax errors corrected (trailing commas removed, markdown fences stripped, single quotes normalized to double quotes, truncated structures closed).","failureModes":["Input is so severely malformed that deterministic repair is impossible — returns error indicating unrecoverable input","Empty or whitespace-only raw_json input — returns validation error","Input is already valid JSON — may return it unchanged or with a success flag","Network or payment (x402) failure results in HTTP 402 or 5xx error"],"whenToPreferThis":"Choose this endpoint when you need deterministic, rule-based JSON repair rather than probabilistic LLM re-generation. Ideal for multi-agent pipelines where JSON from LLM steps may have predictable syntax issues (trailing commas, markdown fences, single quotes) and you need fast, cheap, reliable sanitization without sending the payload back to a large model. Prefer over custom parsing code when operating in environments where crashing on bad JSON is unacceptable.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-21T07:23:07.231Z","isFirstParty":false,"canonicalSlug":"token-intel-agentdiet-dev-deterministic-a2a-broken-json-repair-schema-12f4b582"}