{"uid":"cap_YF9FyeXD8uZHfXv2x--m-","slug":"defi-yield-agentdiet-dev-deterministic-a2a-broken-json-repair-schema-a6f91a55","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://defi-yield.agentdiet.dev/v1/json-validator)","url":"https://defi-yield.agentdiet.dev/v1/json-validator?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__NnLCF90i_JoLG8Uapt-K","protocol":"mpp","methodType":"crypto","chain":"tempo","mode":"charge","costAmount":"0.002","costPer":"request","priority":0,"asset":"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":"defi-yield.agentdiet.dev","brandSlug":"defi-yield-agentdiet-dev-mpp","brandBaseUrl":"https://defi-yield.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 LLM response came back as broken JSON with trailing commas and markdown code fences — can you repair it so it's valid JSON I can actually use: ```{\"name\": \"Alice\", \"score\": 42,}```?","exampleUseCases":[{"title":"Fixing LLM pipeline JSON crashes","prompt":"My agent pipeline keeps crashing because the language model keeps returning JSON with trailing commas and single-quoted keys. Can you repair this malformed output so it's valid: {'user': 'bob', 'items': ['a', 'b',]}"},{"title":"Stripping markdown fences from model output","prompt":"The model wrapped its JSON response in a markdown code block and now my downstream tool can't parse it. Strip the fences and fix any syntax issues so I get clean JSON back: ```json\n{\"status\": \"ok\",\n\"data\": null,}\n```"},{"title":"Recovering truncated JSON from a long generation","prompt":"The LLM hit its token limit mid-response and the JSON got cut off partway through. Here's the truncated string — can you repair it into valid JSON as best as possible: {\"results\": [{\"id\": 1, \"name\": \"Alpha\"}, {\"id\": 2, \"name\": \"Beta\""}],"resultDescription":"Returns a JSON object containing the repaired, valid JSON string with all syntax errors resolved — trailing commas removed, markdown fences stripped, single quotes converted to double quotes, and truncated structures closed — ready for downstream consumption in agent pipelines.","failureModes":["Input is so malformed it cannot be deterministically repaired — returns error indicating irrecoverable structure","Empty or whitespace-only raw_json input fails validation","Input that is already valid JSON still processes but returns unchanged","Extremely long truncated inputs may produce ambiguous completions","Non-JSON content (e.g. plain text, HTML) passed as raw_json may return an error or unexpected output"],"whenToPreferThis":"Choose this endpoint when you need deterministic, rule-based JSON repair rather than LLM-based guessing — ideal for multi-agent pipelines where reliability and consistency matter. Best when the malformation pattern is structural (trailing commas, markdown fences, single quotes, truncation) rather than semantic. Prefer this over writing custom regex fixers or relying on downstream parsers to be lenient.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-23T06:36:03.828Z","isFirstParty":false,"canonicalSlug":"defi-yield-agentdiet-dev-deterministic-a2a-broken-json-repair-schema-ff23e186"}