refactor_code
Refactor code based on an instruction while preserving external behavior. Provide code or file path to receive refactored output with a summary of changes.
Instructions
Refactor code according to an instruction, preserving external behavior.
Provide exactly one of code or file_path. Returns the full refactored
code plus a summary of changes; this tool does not write files itself --
use batch_refactor if you want changes applied to disk.
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": {
"instruction": "<instruction>"
},
"name": "refactor_code"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | No | ||
| think | No | ||
| file_path | No | ||
| instruction | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |