{"uid":"cap_bQdjjjTZlZv-zR8SvIj6K","slug":"shopify-intel-agentdiet-dev-deterministic-a2a-broken-json-repair-9797b725","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://shopify-intel.agentdiet.dev/v1/json-fix)","url":"https://shopify-intel.agentdiet.dev/v1/json-fix?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_MMz-yGLgbatj-V0pxgXGd","protocol":"mpp","methodType":"crypto","chain":"tempo","mode":"charge","costAmount":"0.002","costPer":"request","priority":0,"asset":"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":"shopify-intel.agentdiet.dev","brandSlug":"shopify-intel-agentdiet-dev-mpp","brandBaseUrl":"https://shopify-intel.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 came back from an LLM and it's broken — it has trailing commas, single quotes, and a markdown code fence around it. Can you repair it so it's valid JSON? Here it is: ```{'name': 'Alice', 'age': 30,}```","exampleUseCases":[{"title":"LLM output sanitization in agent pipeline","prompt":"The language model returned this JSON but it's malformed with trailing commas and single quotes — fix it so my pipeline doesn't crash: {\"items\": ['apple', 'banana',], 'count': 2,}"},{"title":"Fixing markdown-wrapped LLM JSON","prompt":"My AI returned a JSON block wrapped in triple-backtick markdown fences and I need clean parseable JSON. Can you strip the fences and repair this: ```json\n{\"status\": \"ok\", \"data\": {\"value\": 42,}}\n```"},{"title":"Recovering truncated JSON from a cut-off response","prompt":"The LLM response got cut off mid-way and the JSON is incomplete — it's missing closing brackets. Can you repair this truncated JSON so I can use it: {\"user\": {\"name\": \"Bob\", \"settings\": {\"theme\": \"dark\""}],"resultDescription":"A repaired, valid JSON object that has had common LLM-output defects corrected, including trailing commas removed, markdown fences stripped, single quotes converted to double quotes, and truncated structures closed — ready for direct use in downstream agents or parsers.","failureModes":["JSON too severely corrupted to deterministically repair — returns error with description","Input string is not JSON-like at all — may return unmodified or with error","Ambiguous truncation with multiple valid completions — may choose one interpretation","Network or payment (x402) failure — returns 402 or 5xx response","Empty raw_json input — returns validation error"],"whenToPreferThis":"Choose this endpoint when your multi-agent or LLM pipeline receives JSON that fails standard parsing due to common LLM formatting errors (trailing commas, markdown code fences, single quotes, truncation). It is preferable to ad-hoc regex fixes or manual parsing workarounds because it handles multiple failure modes deterministically in a single call, at low cost ($0.002/call), with MCP/A2A protocol compatibility.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-21T07:26:01.713Z","isFirstParty":false,"canonicalSlug":"shopify-intel-agentdiet-dev-deterministic-a2a-broken-json-repair-991f500e"}