{"uid":"cap_VI25hooDrulZIgau1hUnn","slug":"mesh-agentdiet-dev-deterministic-a2a-broken-json-repair-schema-cbb100da","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/llm-json-schema-healer)","url":"https://mesh.agentdiet.dev/v1/llm-json-schema-healer?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_FfUNr-I7QXYzs6GQyM98b","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) deterministically so multi-agent pipelines never crash on bad JSON.","exampleAgentPrompt":"The JSON my LLM just returned is broken — it has trailing commas, single quotes instead of double quotes, and a markdown code fence wrapper. Can you repair it so I can use it downstream? Here's the raw string: ```{'name': 'Alice', 'age': 30,}```","exampleUseCases":[{"title":"Fixing LLM output before downstream agent","prompt":"The structured JSON my language model returned has trailing commas and is wrapped in a markdown code block — can you strip the fences and fix the syntax so the next step in my pipeline doesn't crash? Raw output: ```json\n{\"user\": \"bob\", \"score\": 42,}\n```"},{"title":"Repairing truncated API response JSON","prompt":"My LLM truncated its JSON mid-object and the string ends abruptly without closing braces. Can you deterministically repair it so I can extract the fields? Here's the broken JSON: {\"order_id\": \"ORG-999\", \"items\": [{\"sku\": \"ABC\", \"qty\": 2"},{"title":"Normalizing single-quoted JSON from model","prompt":"I'm getting JSON back from my model that uses single quotes instead of double quotes, which breaks JSON.parse. Can you convert it to valid RFC 8259 JSON? Here's the string: {'product': 'widget', 'price': 9.99}"}],"resultDescription":"Returns a repaired, schema-compliant JSON object derived from the input malformed string. The response includes the fixed JSON structure with all syntax errors corrected — trailing commas removed, markdown fences stripped, single quotes normalized to double quotes, and truncated structures closed. The agent receives a valid, parseable JSON object ready for downstream consumption.","failureModes":["Input JSON is so corrupted that deterministic repair is impossible — returns error indicating unrecoverable structure","Input string is empty or missing the required raw_json field — returns 400 validation error","JSON is actually valid but schema validation against a provided schema fails — returns schema mismatch error","Network or payment failure (HTTP 402 if payment not provided) — call fails before processing"],"whenToPreferThis":"Choose this endpoint when you need deterministic, rule-based JSON repair for LLM outputs in automated pipelines — especially when you cannot afford hallucinated or AI-guessed corrections. Prefer this over ad-hoc regex fixes or asking the LLM to re-generate when you need reliability, auditability, and speed. Ideal for multi-agent orchestration layers where downstream tools expect strict JSON and LLM outputs frequently include markdown fences, trailing commas, or single quotes. Not a replacement for schema-aware generation up front, but the best safety net after the fact.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-11-21T06:39:23.057Z","isFirstParty":false,"canonicalSlug":"mesh-agentdiet-dev-deterministic-a2a-broken-json-repair-schema-ae3fa643"}