rename_symbol
Renames a code symbol and all its references across the workspace using text-based matching. Specify old and new strings to update globally.
Instructions
Renames a symbol (function, variable, class, etc.) and all its references across the workspace.
Uses text-based matching to locate the symbol—no coordinate counting required.
Example: filePath: "/path/to/file.py" oldString: "def helper_function(" newString: "def _helper_function("
This will rename helper_function to _helper_function everywhere it's referenced.
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": {
"filePath": "<filePath>",
"oldString": "<oldString>",
"newString": "<newString>"
},
"name": "rename_symbol"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filePath | Yes | ||
| oldString | Yes | ||
| newString | Yes | ||
| line | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |