Format or minify JSON
format_jsonValidate JSON and pretty-print, minify, or sort its object keys, returning the error position when parsing fails so you can fix malformed data quickly.
Instructions
Validate JSON and pretty-print or minify it, optionally sorting object keys. Returns the error position for invalid JSON.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"json": "<json>"
},
"name": "format_json"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| json | Yes | The JSON text | |
| indent | No | 2 | |
| sortKeys | No |