{"uid":"cap_CGZi8L7Mo97Ybz1r6YEeO","slug":"foundry-json-validator-and-formatter-0c9c3b13","name":"Foundry JSON Validator and Formatter","description":"JSON validator and formatter: checks JSON, reports the error line and column, returns pretty and minified forms. Input: JSON text.","url":"https://minty-sprout.onrender.com/v1/json-format?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"input":{"type":"string","maxLength":8000,"description":"JSON text"}}},"responseSchema":{"type":"json","example":{"keys":2,"type":"object","valid":true,"pretty":"{\n  \"a\": 1,\n  \"b\": [\n    1,\n    2\n  ]\n}","minified":"{\"a\":1,\"b\":[1,2]}"}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.001","displayCostAsset":"USDC","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.001/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_CQSXRmONb4aeYhwBNZNLH","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Validates JSON text, reports the error line and column on failure, and returns pretty-printed and minified forms on success.","exampleAgentPrompt":"Can you check if this JSON is valid and give me both a nicely indented version and a minified one: {\"a\":1,\"b\":[1,2]}?","exampleUseCases":[{"title":"Debugging a broken API payload","prompt":"I got a JSON parsing error from my server — can you validate this payload and tell me exactly which line and column the syntax error is on? Here's the text: {\"name\":\"Alice\",\"age\":30,\"tags\":[\"admin\",}"},{"title":"Minifying JSON for a network request","prompt":"Take this JSON config and give me a minified version with all the whitespace stripped out so I can embed it in a URL parameter: {\"host\": \"localhost\", \"port\": 8080, \"debug\": true}"},{"title":"Pretty-printing a JSON API response","prompt":"This JSON response came back as one long line and I can't read it — can you format it with proper indentation so it's human-readable? Here it is: {\"status\":\"ok\",\"data\":{\"id\":42,\"name\":\"test\"}}"}],"resultDescription":"Returns a JSON object with: a 'valid' boolean, the structural 'type' (object/array/etc.), count of top-level 'keys', a 'pretty' pretty-printed string with 2-space indentation, and a 'minified' compact string. On invalid JSON, reports the error line and column instead.","failureModes":["Input exceeds 8000 character limit — request rejected","Input is not JSON at all (e.g. plain text) — returns valid=false with error position","Malformed but partially valid JSON — returns line/column of first syntax error","Empty input — likely returns valid=false","Network or service unavailability on Render.com free tier — connection timeout or 502 error","Payment failure via x402 protocol — 402 response, endpoint not invoked"],"whenToPreferThis":"Choose this endpoint when you need to both validate AND format JSON in a single call, especially when you want to know the exact line/column of a syntax error. It's ideal for developer tooling, debugging API payloads, or preparing JSON for display vs. transmission. Prefer it over generic text processors when the input is specifically JSON and you need pretty-printed or minified output alongside validity status.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-11-01T06:55:25.953Z","isFirstParty":false,"canonicalSlug":"foundry-json-validator-and-formatter-0c9c3b13"}