Skip to main content
Glama

remove_import_name

Removes a single imported name from a named-import statement in Python or JavaScript/TypeScript files, handling edge cases like removing the entire line when it's the last name.

Instructions

Remove a name from a named-import statement.

  • Python (.py): from <module> import a, b, c

  • JS/TS: import { a, b, c } from "<module>"

If the name removed is the only remaining one AND there are no other bindings (default / namespace) in the same statement, the entire import line is removed. Raises an error if removing the last name would leave an invalid import Default, {} from "mod" fragment.

Use this when: You want to remove a single name from a multi-name import. Don't use this when: You want to remove the entire import line -> use remove_import.

Example (Python): module="typing" name="List" Example (TS): module="./utils" name="bar"

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_pathYes
moduleYes
nameYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

No annotations provided, so description carries full burden. It discloses edge cases: removing the last name removes entire line if no other bindings, and raises error for invalid fragments. Could mention permissions or side effects, but current coverage is strong.

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

Conciseness4/5

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

Description is concise and well-structured with bullet points and examples. A few lines could be streamlined, but overall it efficiently conveys necessary information.

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

Completeness4/5

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

Covers purpose, parameters, usage, and error cases. Does not explain output, but an output schema is present. For a code-modifying tool, it provides sufficient context.

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

Parameters4/5

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

Input schema has 0% description coverage, but description compensates with examples and clarifies the meaning of 'module' and 'name' via Python and TS examples. 'file_path' is self-explanatory but lacks explicit description.

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?

Clearly states the tool removes a name from a named-import statement. Differentiates from sibling 'remove_import' by specifying it's for single name removal, not entire line.

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?

Explicitly states when to use (removing a single name from a multi-name import) and when not to (use 'remove_import' instead). Provides language-specific examples and explains error conditions.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/kambleakash0/agent-skills'

If you have feedback or need assistance with the MCP directory API, please join our Discord server