Format a file
nvim_formatApply Neovim's configured formatter to a file or line range, then save it to fix code formatting issues.
Instructions
Format a whole file or a line range with the formatter Neovim is configured to use, then save it.
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": {
"path": "<path>"
},
"name": "nvim_format"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | File path | |
| wait_ms | No | Format timeout | |
| end_line | No | Range end, inclusive | |
| start_line | No | Range start, 1-based |