Format and validate JSON
format_jsonPretty-print or minify JSON. A number that does not fit in a JavaScript number keeps the digits you sent. Returns the formatted text when it is valid, or the line and column of each syntax error.
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 | JSON text to format or validate. | |
| indent | No | 2 | |
| minify | No | ||
| sortKeys | No | Sort object keys. Array order is kept. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| valid | Yes | ||
| errors | Yes | ||
| output | Yes |