{"uid":"cap_CXLtggJ3JgcbdEeiq-7oS","slug":"agent402-tools-json-format-c438bd8c","name":"agent402.tools JSON Format","description":"Validate, pretty-print, or minify JSON. Returns parse errors with position when invalid.","url":"https://agent402.tools/api/json-format","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"json":{"type":"string","description":"JSON text to validate/format (max 100KB)"},"indent":{"type":"number","description":"Spaces of indentation; 0 = minify (default 2)"}}},"responseSchema":{"type":"json","example":{"valid":true,"formatted":"{\n  \"a\": 1\n}"}},"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_eWV_xrHtU8VQLrXnjmCFF","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, pretty-prints, or minifies a JSON string, returning parse errors with position details when the input is invalid.","exampleAgentPrompt":"Can you validate and pretty-print this JSON for me using 4-space indentation: '{\"name\":\"Alice\",\"age\":30,\"active\":true}'?","exampleUseCases":null,"resultDescription":"Returns the formatted or minified JSON string if valid, or a parse error message including the position (line/column) of the syntax error when the input is invalid JSON.","failureModes":["Input JSON exceeds 100KB limit — rejected with size error","Malformed JSON input — returns parse error with position info","Missing required 'json' field — returns validation error","Non-numeric indent value — returns parameter error"],"whenToPreferThis":"Use this endpoint when you need to validate JSON correctness, reformat JSON for human readability with configurable indentation, or minify JSON by passing indent=0. It reports parse errors with position, making it useful for debugging malformed JSON. Prefer this over generic text-processing endpoints when the input is specifically JSON.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T19:14:05.148Z","isFirstParty":false}