{"uid":"cap_MOdUM-fQiJBX3n0aWoCPc","slug":"mesh-agentdiet-dev-deterministic-a2a-broken-json-repair-schema-7f72a5ce","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://mesh.agentdiet.dev/v1/json-fix)","url":"https://mesh.agentdiet.dev/v1/json-fix?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_wuDt_EeUzmfi7TRDi_UbG","protocol":"mpp","methodType":"crypto","chain":"tempo","mode":"charge","costAmount":"0.002","costPer":"request","priority":0,"asset":"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":"mesh.agentdiet.dev","brandSlug":"mesh-agentdiet-dev-mpp","brandBaseUrl":"https://mesh.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 JSON from the LLM has trailing commas and markdown code fences and it's breaking my pipeline — can you fix it and give me back clean, valid JSON? Here's the raw output: ```json {\"name\": \"Alice\", \"age\": 30,} ```","exampleUseCases":[{"title":"Fixing LLM output before database write","prompt":"The language model just returned this JSON but it has trailing commas and single quotes and my database insertion is failing — please repair it so it's valid: {'user': 'bob', 'score': 42,}"},{"title":"Cleaning markdown-wrapped JSON in agent pipeline","prompt":"My agent pipeline keeps crashing because the upstream model wraps its JSON in markdown code fences. Can you strip the fences and fix any other issues in this string: ```json {\"items\": [1, 2, 3,]} ```"},{"title":"Recovering truncated JSON from incomplete LLM response","prompt":"The LLM cut off mid-response and I got a truncated JSON object that ends abruptly — can you repair it into something valid so I can continue processing? Here it is: {\"product\": \"widget\", \"details\": {\"color\": \"blue\""}],"resultDescription":"A repaired, valid JSON object derived from the malformed input, with all syntax errors corrected — including removed trailing commas, converted single quotes to double quotes, stripped markdown fences, and closed any truncated structures — ready to be parsed by downstream pipeline steps.","failureModes":["Input JSON is so severely corrupted that deterministic repair is impossible, returning an error","Input string is completely empty or not JSON-like at all","Ambiguous truncation where the intended structure cannot be inferred, resulting in best-effort output that may differ from original intent","Payment authorization failure for x402 micropayment, blocking the request"],"whenToPreferThis":"Choose this endpoint when your multi-agent or LLM pipeline receives JSON outputs that frequently contain LLM-specific artifacts like trailing commas, markdown code fences, single-quoted keys, or truncated structures. It is especially valuable in automated pipelines where a crashed JSON parser would halt execution and where you need a deterministic, cheap ($0.002/call) repair rather than sending the output back to the LLM for correction. Prefer this over ad-hoc regex fixes or LLM-based re-prompting when you need reliability, low latency, and idempotent behavior across retries.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-11-21T12:40:08.177Z","isFirstParty":false,"canonicalSlug":"mesh-agentdiet-dev-deterministic-a2a-broken-json-repair-schema-ae3fa643"}