{"uid":"cap_dLEoL793O1v2Ab5k9zo1P","slug":"llms-generator-agentdiet-dev-deterministic-a2a-broken-json-repair-e666737c","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://llms-generator.agentdiet.dev/v1/json-validator)","url":"https://llms-generator.agentdiet.dev/v1/json-validator?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_NeZjsLV4xFyF9zhB28CVJ","protocol":"mpp","methodType":"crypto","chain":"tempo","mode":"charge","costAmount":"0.002","costPer":"request","priority":0,"asset":"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":"llms-generator.agentdiet.dev","brandSlug":"llms-generator-agentdiet-dev-mpp","brandBaseUrl":"https://llms-generator.agentdiet.dev","brandDocsUrl":null,"whatItDoes":"Repairs truncated or malformed LLM JSON outputs (trailing commas, markdown fences, single quotes) so multi-agent pipelines can process them without crashing.","exampleAgentPrompt":"This JSON string came back from the LLM and it won't parse — it has trailing commas and markdown code fences around it. Can you fix it and give me back valid JSON? Here it is: ```{\"name\": \"Alice\", \"age\": 30,}```","exampleUseCases":[{"title":"Fix LLM output before pipeline handoff","prompt":"The language model just returned this JSON but it has trailing commas and single quotes instead of double quotes — can you repair it so the next agent in the pipeline can parse it? Here's the broken output: {'user': 'Bob', 'score': 42,}"},{"title":"Strip markdown fences from agent response","prompt":"My agent wrapped its JSON response in triple-backtick markdown fences and now the parser is crashing. Can you clean it up and give me back the raw valid JSON? The output was: ```json\n{\"status\": \"ok\", \"items\": [1, 2, 3]}\n```"},{"title":"Recover truncated JSON from a long generation","prompt":"The LLM ran out of tokens and the JSON got cut off mid-object — it ends with an open array and no closing braces. Can you try to repair and close it properly? Here's what I got: {\"results\": [{\"id\": 1, \"value\": \"hello\"}, {\"id\": 2"}],"resultDescription":"Returns a JSON object containing the repaired, syntactically valid version of the input JSON string, with all common LLM-induced errors (trailing commas, markdown fences, single quotes, truncation) corrected deterministically.","failureModes":["Input JSON is too severely truncated or corrupted to repair — returns an error indicating the string is unrecoverable","Missing required raw_json parameter — returns a 400-level error","Input is not JSON at all (e.g. plain prose) — may return an error or unexpected result","Extremely large JSON strings may exceed query parameter size limits on a GET request"],"whenToPreferThis":"Choose this endpoint when you need a deterministic, rule-based JSON repair rather than an LLM-based rewrite — ideal for multi-agent pipelines where consistency and predictability matter. Prefer it over manual parsing hacks when dealing with common LLM output artifacts like trailing commas, markdown wrapping, or single quotes at scale for $0.002 per call.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-21T07:22:16.816Z","isFirstParty":false,"canonicalSlug":"llms-generator-agentdiet-dev-deterministic-a2a-broken-json-repair-76e2e18d"}