change_signature
Add, remove, or reorder a Python function’s parameters and update every call site using type-resolved references, with previews for unsafe or ambiguous edits.
Instructions
Add, remove or reorder a function's parameters and update every call site. Example:
change_signature(name="send_mail", add=[{"name": "retries", "annotation": "int", "default": "3"}]).
name is a function, a method (Class.method) or a class (its __init__).
add: list of{"name", "annotation"?, "default"?, "value"?, "position"?, "keyword_only"?}.defaultis written in the definition and callers need not change;valueis inserted at every call site asname=value(give both for a required-at-call parameter with a default).positionis a 0-based index among the parameters (self/cls not counted); the default is the end. One ofdefault/valueis required.remove: parameter names; the matching argument is dropped at each call.reorder: the complete new order of the named parameters. Positional arguments are rearranged, and turned into keywords where a position would no longer line up.
Call sites come from the type checker's references, so calls through injected
dependencies and typed attributes are found, not just textual matches. Overriding
methods get the same change (include_overrides). Calls using *args/**kwargs
and places where the function is passed around as a value are listed as manual
work rather than guessed at. Unresolved alias calls, calls with comments, and
effectful argument reorderings are also listed for manual review. Decorators
and docstrings mentioning removed parameters produce notes. Writes when new errors stay within max_new_errors
(default 0), else previews with an id for apply_edit; apply=false always previews.
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": {
"name": "<name>"
},
"name": "change_signature"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| add | No | ||
| name | Yes | ||
| apply | No | ||
| remove | No | ||
| reorder | No | ||
| file_path | No | ||
| allow_large | No | ||
| max_new_errors | No | ||
| include_overrides | No |