{"uid":"cap_S3sqn20M4SlZAjenNy3dx","slug":"token-intel-agentdiet-dev-deterministic-a2a-broken-json-repair-schema-fe89bb0b","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/structured-output)","url":"https://token-intel.agentdiet.dev/v1/structured-output?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_fs9Jgt1I0sM5pRgWORIqp","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, parseable JSON to prevent multi-agent pipeline crashes.","exampleAgentPrompt":"The LLM just returned this broken JSON with trailing commas and markdown fences — can you repair it into valid, parseable JSON so our pipeline doesn't crash? Here it is: ```json {\"name\": \"Alice\", \"score\": 95, } ```","exampleUseCases":[{"title":"Fix LLM output before database write","prompt":"Our language model returned this malformed JSON with a trailing comma and I need to write it to the database — can you repair it first? Here's what it gave us: {\"user_id\": 42, \"status\": \"active\", }"},{"title":"Strip markdown fences from agent response","prompt":"The agent wrapped its JSON output in triple-backtick markdown fences and now my parser is failing — can you clean this up into raw valid JSON? Here's the raw string: ```json\\n{\"items\": [\"apple\", \"banana\"]}\\n```"},{"title":"Recover truncated JSON mid-pipeline","prompt":"We got a cut-off JSON string from the model that stops mid-value and our pipeline crashed — can you deterministically repair this truncated JSON so we can continue? Here it is: {\"order\": {\"id\": 101, \"product\": \"widget\", \"qty\":"}],"resultDescription":"A JSON object containing the repaired, valid JSON that was reconstructed from the malformed input. The response corrects issues like trailing commas, markdown code fences, single-quoted keys/values, truncated structures, and other common LLM JSON formatting errors.","failureModes":["Input JSON too severely truncated or corrupted to deterministically repair — returns error indicating ambiguous repair","Empty or null raw_json parameter — returns 400 bad request","Input is not recognizable as JSON at all (e.g. plain prose) — may return error or unexpected output","Payment not processed (HTTP 402) — request blocked until x402 micropayment is completed"],"whenToPreferThis":"Choose this endpoint when your multi-agent or LLM pipeline receives structured JSON outputs that are malformed, truncated, or wrapped in markdown fences and you need a deterministic (non-LLM) fix rather than asking another model to re-parse. Ideal for production pipelines where reliability matters and you cannot afford downstream crashes from bad JSON. Prefer over prompt-engineering workarounds when you need a programmatic, repeatable repair step.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-21T07:21:46.333Z","isFirstParty":false,"canonicalSlug":"token-intel-agentdiet-dev-deterministic-a2a-broken-json-repair-schema-12f4b582"}