format_json
Validate and re-print a JSON string. Returns JSON { valid, formatted, minified } — the indented form and the whitespace-free form as plain strings, with no syntax highlighting or colour. Invalid JSON is rejected with the parser's own error message rather than returned as valid:false, so a successful call is proof the input parses. Round-tripping through the parser normalises the document: key order is kept but comments, trailing commas and duplicate keys are lost, and large integers lose precision.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| json | Yes | The JSON document as a string. Must be strict JSON — comments and trailing commas are parse errors. | |
| indent | No | Spaces per indent level in `formatted`, 0 to 10. Default 2; a value outside that range or a non-number silently falls back to 2. Use 0 for newlines with no indentation, or read `minified` for no whitespace at all. |