Skip to main content
Glama

remove_import_name

Remove a specific name from a named import statement, such as removing 'List' from 'from typing import List, Dict'. Automatically removes the entire import if it is the only 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?

Discloses edge cases: automatic removal of the entire import line when the last name is removed and no other bindings exist, and error on invalid fragment. Since no annotations are provided, this adds necessary behavioral context. Minor omission: doesn't specify whether the operation requires file write permissions or is reversible.

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?

The description is concise, structured with bullet points and an example block. The main action is stated first, and every sentence adds value. No unnecessary words.

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?

Given the simple input schema (3 required params) and the existence of an output schema (so return values are documented), the description provides sufficient context: behavior, edge cases, examples, and usage guidance. It is complete for an agent to use this tool correctly.

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 coverage is 0%, but description provides concrete examples (Python and TS) that clarify the 'module' and 'name' parameters. However, 'file_path' is not explained, and the description lacks explicit definitions for each parameter. The examples partly compensate but not fully.

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?

The description clearly states the tool removes a name from a named-import statement, with language-specific examples. It explicitly distinguishes from the sibling 'remove_import' by contrasting single-name removal vs. entire line removal.

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?

Provides explicit 'Use this when' and 'Don't use this when' instructions, naming the alternative tool 'remove_import'. This helps the agent select the correct tool for the task.

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/ast-editor'

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