{"uid":"cap_dtF_Vwpic9OBkYJ3RkKfV","slug":"workflows-agentdiet-dev-deterministic-a2a-broken-json-repair-schema-5d0821e0","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://workflows.agentdiet.dev/v1/json-fix)","url":"https://workflows.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_RDwsIPz7aRGyAGtHWnoyw","protocol":"mpp","methodType":"crypto","chain":"tempo","mode":"charge","costAmount":"0.002","costPer":"request","priority":0,"asset":"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":"workflows.agentdiet.dev","brandSlug":"workflows-agentdiet-dev-mpp","brandBaseUrl":"https://workflows.agentdiet.dev","brandDocsUrl":null,"whatItDoes":"Repairs truncated or malformed LLM-generated JSON (trailing commas, markdown fences, single quotes) so multi-agent pipelines can continue without crashing.","exampleAgentPrompt":"This JSON string came back from the LLM with trailing commas and markdown fences and it's breaking my pipeline — can you fix it and return clean, valid JSON: ```{\"name\": \"Alice\", \"age\": 30,}```?","exampleUseCases":[{"title":"LLM output sanitization in agent pipeline","prompt":"My agent just got this response from GPT and it has trailing commas and single quotes that are crashing the next step — fix it into valid JSON: {'user': 'bob', 'score': 42,}"},{"title":"Stripping markdown fences from structured output","prompt":"The model wrapped its JSON answer in triple backticks and now my parser is failing. Can you clean this up and return just the valid JSON object: ```json\n{\"items\": [1, 2, 3]}\n```"},{"title":"Repairing truncated JSON from a token-limited response","prompt":"I hit the token limit mid-response and got a cut-off JSON string — can you repair and complete it as best as possible so I can extract the data: {\"order_id\": \"ORD-999\", \"customer\": {\"name\": \"Jane\""}],"resultDescription":"A JSON object containing the repaired, syntactically valid version of the input JSON. The output resolves issues like trailing commas, markdown code fences, single-quoted keys or values, and truncation, returning a well-formed JSON structure that downstream systems can safely parse.","failureModes":["Input is so severely malformed it cannot be deterministically repaired — returns an error or best-effort partial result","Input string is empty or below minimum length (minLength: 1) — returns validation error","JSON is structurally ambiguous and repair introduces unintended data changes","Network timeout or service unavailability returns a non-200 HTTP response","x402 payment not fulfilled — returns HTTP 402 Payment Required"],"whenToPreferThis":"Choose this endpoint when your multi-agent pipeline receives JSON from an LLM that is syntactically invalid due to common LLM artifacts like trailing commas, markdown fences, single quotes, or truncation, and you need a deterministic, rule-based repair rather than asking the LLM to regenerate. Prefer this over retrying the LLM when latency or cost matters, or when you need a reliable fix pass before downstream schema validation.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-21T12:42:45.511Z","isFirstParty":false,"canonicalSlug":"workflows-agentdiet-dev-deterministic-a2a-broken-json-repair-schema-ded1fe6a"}