{"uid":"cap_CYBeOGlScvVzonrEZcPVN","slug":"agentdiet-dev-deterministic-a2a-broken-json-repair-schema-validator-f54a1614","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/malformed-json-healer)","url":"https://agentdiet.dev/v1/malformed-json-healer?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_3dDQHP8uBWxihYg9LmZZE","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 malformed, truncated, or improperly formatted LLM JSON outputs (trailing commas, markdown fences, single quotes) into valid, parseable JSON so multi-agent pipelines don't crash.","exampleAgentPrompt":"This JSON from the LLM response is broken — it has trailing commas and markdown fences around it. Can you repair it and give me back valid, parseable JSON? Here's the raw string: ```{\"name\": \"Alice\", \"age\": 30,}```","exampleUseCases":[{"title":"LLM pipeline output sanitization","prompt":"The language model in my pipeline returned this malformed JSON with a trailing comma and single quotes — can you fix it so it's valid and I can parse it without crashing? Here's the string: {'name': 'Bob', 'score': 42,}"},{"title":"Markdown-fenced JSON cleanup","prompt":"My agent got back a response wrapped in triple-backtick markdown code fences and the JSON inside has some issues. Can you strip the fences and repair the JSON so it's clean? Raw output: ```json\n{\"status\": \"ok\", \"data\": [1, 2, 3,]}\n```"},{"title":"Truncated JSON recovery","prompt":"The JSON I got from my LLM was cut off mid-stream and is incomplete — something like {\"user\": \"carol\", \"items\": [\"a\", \"b\". Can you deterministically repair it into valid JSON so my next agent step doesn't fail?"}],"resultDescription":"A repaired, syntactically valid JSON object with all formatting issues resolved — trailing commas removed, markdown fences stripped, single quotes converted to double quotes, and truncations patched — ready for programmatic parsing downstream.","failureModes":["Input JSON is so severely malformed or truncated that deterministic repair is not possible, returning an error","Input string is empty or whitespace-only (minLength violation)","JSON structure is ambiguous beyond repair (e.g. deeply nested truncation with no recoverable schema)","Network timeout or service unavailability returns a non-200 response","Payment failure via x402 protocol blocks the request"],"whenToPreferThis":"Choose this endpoint when your multi-agent or LLM pipeline is receiving JSON outputs that are systematically malformed in predictable ways (trailing commas, markdown wrapping, single quotes, minor truncations) and you need a deterministic, cheap, fast fix rather than asking the LLM to regenerate. Ideal when reliability and cost-efficiency matter more than semantic understanding of the JSON content.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-21T07:22:53.080Z","isFirstParty":false,"canonicalSlug":"agentdiet-dev-deterministic-a2a-broken-json-repair-schema-validator-dd9f7439"}