Skip to main content
Glama

remove_import_name

Destructive

Remove a single name from a multi-name Python or JS/TS import statement. Use when dropping one imported name without deleting the whole import line.

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"

Input Schema

NameRequiredDescriptionDefault
nameYesOne imported name, e.g. 'Optional'.
moduleYesModule of the import as written, without quotes (e.g. 'typing' or './utils').
file_pathYesAbsolute path to the source or config file.

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv3.2.0
    • addedInput schema / properties / file_path / description
      Added value: +"Absolute path to the source or config file."
    • addedInput schema / properties / module / description
      Added value: +"Module of the import as written, without quotes (e.g. 'typing' or './utils')."
    • addedInput schema / properties / name / description
      Added value: +"One imported name, e.g. 'Optional'."
  2. First observedv2.0.1

TDQS

A4.7/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Goes well beyond the destructiveHint=true annotation by disclosing concrete edit semantics: a name on its own line takes the line and its comment, removing the only name removes the statement, and the default-import empty-braces case is refused with a prescribed workaround (remove_import then add_import). This is exactly the failure-mode context an agent needs before invoking a destructive edit.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded action sentence, then structured Use/Don't-use/Example blocks with no filler. The denser braces-refusal sentence is behaviorally necessary rather than padding.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Output schema exists so return values need no explanation; parameters are fully covered in the schema; and the description supplies the edge cases and refusal behavior that structured fields cannot express.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100% and each parameter already documents its format, so baseline is 3. The description's example (module="typing", name="List") illustrates the pairing but largely restates what the schema already says about module and name.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Names a specific verb and resource ('Remove one name from a from-import / import {...} statement') and covers both Python and JS/TS syntax. It is immediately distinguishable from sibling remove_import (whole statement) and add_import_name.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicit 'Use this when: dropping one name from a multi-name import' and 'Don't use this when: removing the whole import line (remove_import)', naming the alternative tool and the condition that selects it.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.