format_json
Parse and pretty-print JSON strings with custom indentation. Reliably handles files of any size without crashing.
Instructions
Parse and pretty-print a JSON string with configurable indentation. Handles JSON of any size — the only MCP JSON tool that does not crash on 100MB+ files. Returns the formatted result along with stats (node count, depth, size, parse time).
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 string to format. Can be any size — large files are parsed in a worker-like pattern to avoid blocking. | |
| indent | No | Number of spaces for indentation (default: 2) |