remove_import_name
Remove one named import from a Python or JavaScript/TypeScript import statement, deleting the statement when it is the only name and avoiding invalid empty default-import braces.
Instructions
Remove one name from a from <module> import ... (Python) or import { ... } from "<module>" (JS/TS) statement. A name on a line of its own
goes with that line and its comment. Removing the only name removes the
statement, but is refused when a default import would be left with
empty braces (import D, { a } from "m"): use remove_import, then
add_import.
Use this when: dropping one name from a multi-name import. Don't use this when: removing the whole import line (remove_import).
Example: module="typing" name="List"
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": {
"file_path": "<file_path>",
"module": "<module>",
"name": "<name>"
},
"name": "remove_import_name"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | One imported name, e.g. 'Optional'. | |
| module | Yes | Module of the import as written, without quotes (e.g. 'typing' or './utils'). | |
| file_path | Yes | Absolute path to the source or config file. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |