{"uid":"cap_mjuAv1s7AAebBwoiEmWQ2","slug":"agentdiet-dev-deterministic-a2a-broken-json-repair-schema-validator-acd46181","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://agentdiet.dev/v1/repair)","url":"https://agentdiet.dev/v1/repair?utm_source=zero.xyz","method":"POST","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_IeEQaMyxjjP_d_dqdmuBg","protocol":"mpp","methodType":"crypto","chain":"tempo","mode":"charge","costAmount":"0.002","costPer":"request","priority":0,"asset":"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":"agentdiet.dev","brandSlug":"agentdiet-dev-mpp","brandBaseUrl":"https://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 LLM response came back with broken JSON — it has trailing commas, single-quoted keys, and is wrapped in markdown code fences. Can you repair it so I can parse it? Here's the raw string: ```{'name': 'Alice', 'age': 30,}```","exampleUseCases":[{"title":"Fix LLM output before downstream agent","prompt":"My language model just returned this JSON but it has trailing commas and markdown backticks around it — can you clean it up so the next agent in my pipeline can parse it? Here's what came back: ```{\"name\": \"Bob\", \"score\": 95,}```"},{"title":"Repair truncated agent response","prompt":"One of my agents returned a JSON response that got cut off mid-object and is missing closing braces. Can you repair it deterministically so I can continue processing? The raw output is: {\"items\": [{\"id\": 1, \"label\": \"foo\""},{"title":"Sanitize single-quoted JSON from tool call","prompt":"A tool in my workflow returned JSON using single quotes instead of double quotes and it's breaking my parser — can you fix it to valid JSON? The string is: {'status': 'ok', 'results': ['a', 'b']}"}],"resultDescription":"A repaired, valid JSON object ready for downstream parsing — with markdown fences stripped, trailing commas removed, single quotes converted to double quotes, and truncated structures closed. The response is a JSON object containing the cleaned result.","failureModes":["Input is so severely malformed that deterministic repair is impossible — returns error indicating unrecoverable structure","Input is not JSON-like at all (e.g. plain prose) — repair cannot be applied","Payment not completed (x402 payment required before processing)","Empty raw_json string — rejected by input validation (minLength:1)","Idempotency-Key collision with a prior request that had different content — may return cached result"],"whenToPreferThis":"Choose this endpoint when you need deterministic, rule-based JSON repair for LLM or agent outputs rather than AI-assisted guessing — ideal for multi-agent pipelines where consistent, reproducible fixes to trailing commas, markdown fences, single quotes, and minor truncation are required. Prefer this over writing custom regex fixups or using a general-purpose LLM to self-repair, especially when cost ($0.002/call), auditability, and pipeline reliability matter. Best suited for structured agentic workflows where downstream steps depend on valid parseable JSON.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-23T06:37:38.516Z","isFirstParty":false,"canonicalSlug":"agentdiet-dev-deterministic-a2a-broken-json-repair-schema-validator-dd9f7439"}