{"uid":"cap_IsXwEZY3lEMqgUhusy4gZ","slug":"agent402-uk-json-format-validate-ea964107","name":"Agent402 UK JSON Format & Validate","description":"Don't burn tokens on deterministic work. Go/no-go jobs first: payout preflight, text firewall (PII/secrets), budget check — then rails, calendars, finmath. x402 USDC on Base. UK + global. agent402.co.uk — not agent402.tools. $0.001–$0.002 USDC on Base. No API keys.","url":"https://agent402.co.uk/v1/utils/json/format","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"json":{"type":"string","description":"JSON string"},"indent":{"type":"number","description":"Indent spaces 0-8"}}},"responseSchema":{"type":"json","example":{"type":"object","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":"down","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_GPXbwRsvFxr3jGc6o1nZt","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 and pretty-prints a JSON string, returning parse errors or a formatted version with configurable indentation","exampleAgentPrompt":"Can you validate and pretty-print this JSON string for me with 2-space indentation: '{\"name\":\"Alice\",\"age\":30,\"active\":true}'? I want to make sure it parses correctly before I use it as a config.","exampleUseCases":[{"title":"Pre-flight tool argument validation","prompt":"Before I pass this JSON to the next tool, can you check it's valid and format it with 2-space indentation? Here it is: '{\"endpoint\":\"https://api.example.com\",\"retries\":3,\"timeout\":5000}'"},{"title":"Debug malformed config JSON","prompt":"I think there's a syntax error in this JSON — can you validate it and tell me exactly what's wrong? '{\"user\":\"bob\",\"roles\":[\"admin\",\"editor\",}'"},{"title":"Format JSON blob before caching","prompt":"I need to store this JSON in a cache and want it nicely formatted with 4-space indentation first — can you format and validate it? '{\"task\":\"summarise\",\"model\":\"gpt-4\",\"maxTokens\":512}'"}],"resultDescription":"Returns an object with a 'valid' boolean, the detected JSON 'type', a 'formatted' string (the pretty-printed JSON if valid), and any parse error message if the input is malformed.","failureModes":["Malformed JSON input returns valid=false with a descriptive parse error message rather than a formatted string","Indent value outside 0–8 range may be rejected or clamped","Empty string input likely returns a parse error","Non-string JSON field (e.g. passing a raw object instead of a string) may cause a schema validation error"],"whenToPreferThis":"Use this endpoint when an agent needs a fast, deterministic, side-effect-free JSON validator with pretty-print output — particularly before writing configs, constructing tool arguments, or storing blobs. Prefer this over LLM-based JSON repair when you need a reliable parse error message to act on, or when you need consistent indentation (0–8 spaces). Not suited for JSON Schema validation against a schema definition (use the sibling JSON Schema validator endpoint for that).","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-15T10:28:10.603Z","isFirstParty":false}