ruff_format
Format Python files with Ruff, check if formatting is needed, and set custom line length or config file path.
Instructions
Format Python code using Ruff
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": "ruff_format"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Path to file or directory to format | |
| check_only | No | Only check if files need formatting, don't format | |
| config_path | No | Path to Ruff configuration file. If not provided, Ruff will auto-discover config files (pyproject.toml, ruff.toml) in the project directory. | |
| line_length | No | Maximum line length. Overrides config file setting. |