{"uid":"cap_pjubxH3LuaA9DP2D5wwOe","slug":"agentdiet-json-normalizer-f66f89a0","name":"agentdiet-json-normalizer","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://agentdiet.dev/v1/json-normalizer)","url":"https://agentdiet.dev/v1/json-normalizer?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":["x402"],"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":"unknown","protocol":"x402","network":"base","amountUsd":null,"per":"call","confidence":"unknown"},{"kind":"static","protocol":"mpp","network":"tempo","amountUsd":"0.002","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_-rzatePf9Z9R0KDrHCELn","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0","costPer":"request","priority":0,"asset":"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913","unit":"request","depositMicros":null,"planRef":null},{"uid":"pm_wC-LNh91McNbKquUnqFmt","protocol":"mpp","methodType":"crypto","chain":"tempo","mode":"charge","costAmount":"0.002","costPer":"request","priority":0,"asset":"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Repairs truncated or malformed LLM JSON outputs (trailing commas, markdown fences, single quotes) so multi-agent pipelines never crash on bad JSON.","exampleAgentPrompt":"My LLM just returned this broken JSON with trailing commas and markdown fences — can you repair it so I can parse it: ```{\"name\": \"Alice\", \"score\": 42,}```?","exampleUseCases":[{"title":"Fixing LLM pipeline crash on bad JSON","prompt":"My agent pipeline keeps crashing because the language model sometimes returns JSON with trailing commas or missing closing brackets — can you automatically repair whatever raw JSON string I pass in so the next step doesn't break?"},{"title":"Stripping markdown fences from model output","prompt":"The model wrapped its JSON response in triple backtick markdown fences again — something like ```json {\"result\": true} ``` — can you strip those out and give me clean parseable JSON?"},{"title":"Normalizing single-quoted JSON from agent","prompt":"One of my sub-agents is returning JSON with single quotes instead of double quotes, like {'key': 'value'} — can you normalize it to valid JSON so my downstream parser stops throwing errors?"}],"resultDescription":"Returns a repaired, schema-valid JSON object with all syntax errors corrected: trailing commas removed, markdown fences stripped, single quotes converted to double quotes, and truncated structures closed. The response is immediately parseable JSON ready for downstream consumption in a multi-agent pipeline.","failureModes":["Input so severely malformed that deterministic repair is impossible — returns an error indicating unrecoverable JSON","Empty or null raw_json query parameter — returns validation error","Non-JSON content passed as input (e.g., plain text prose) — may return best-effort parse or error","Extremely long truncated JSON where structural intent cannot be inferred — may produce incorrect completion"],"whenToPreferThis":"Choose this endpoint when your multi-agent pipeline receives LLM-generated JSON that fails standard JSON.parse() due to common LLM quirks: trailing commas, markdown code fences, single quotes, or mild truncation. It is deterministic (same input always yields same output), making it safe to use as a reliable normalization step. Prefer this over writing your own regex fixes when you want a hosted, pay-per-call microservice that handles the full range of common LLM JSON malformations without maintaining code.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-20T12:34:55.595Z","isFirstParty":false,"canonicalSlug":"agentdiet-json-normalizer-f66f89a0"}