rename_symbol
Rename Python symbols everywhere they are used, type-check the result before writing, and include linked overrides or Protocol members to prevent broken references.
Instructions
Rename a symbol everywhere it is used, type-checking the result before writing it.
Example: rename_symbol(name="UserService.create_user", new_name="register_user").
Give name (dotted Class.method accepted; file_path narrows it) or
file_path + line + column (1-indexed). Use parameter="x" with a
function's name to rename one of its parameters (keyword arguments at call
sites follow).
Built on ty's rename (imports, aliases, keyword arguments) plus what ty
misses: with linked=true (default) overriding methods in subclasses,
super().name() calls, and Protocol members together with the classes that
satisfy them are renamed as one, since renaming only one side would silently
break the override or the conformance. The result lists every extra member
it included, and the places still using the old name that the type checker
could not link (untyped attribute accesses, strings, comments, docs).
Writing: apply=true (default) writes when the new errors are within
max_new_errors (default 0); otherwise nothing is written and you get a
preview id for apply_edit. apply=false always previews. undo_edit reverts.
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": {
"new_name": "<new_name>"
},
"name": "rename_symbol"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| line | No | ||
| name | No | ||
| apply | No | ||
| column | No | ||
| linked | No | ||
| new_name | Yes | ||
| file_path | No | ||
| parameter | No | ||
| allow_large | No | ||
| max_new_errors | No |