Skip to main content
Glama

remove_import

Destructive

Remove an unused import line from a source file by matching its exact text with surrounding whitespace stripped, preserving the rest of the file.

Instructions

Remove an import line, matched by its text with surrounding whitespace stripped.

Use this when: removing an unused import. Don't use this when: removing one name from a multi-name import (remove_import_name).

Example: import_text="import os"

Input Schema

NameRequiredDescriptionDefault
file_pathYesAbsolute path to the source or config file.
import_textYesExact import line to remove (e.g. 'import os').

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv3.2.0
    • addedInput schema / properties / file_path / description
      Added value: +"Absolute path to the source or config file."
    • addedInput schema / properties / import_text / description
      Added value: +"Exact import line to remove (e.g. 'import os')."
  2. First observedv1.2.0

TDQS

A4.4/5.0
Behavior3/5

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

Annotations already declare destructiveHint=true and readOnlyHint=false, so the agent knows this mutates the file. The description adds the whitespace-stripping match rule, which is genuine behavioral context, but it says nothing about what happens when the import is not found, whether the file must exist, or whether the file is rewritten/backed up. With annotations covering the safety profile, this is adequate but not rich.

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?

Purpose statement first, then when/when-not, then a one-line example — everything is front-loaded and every sentence carries routing or matching information. No filler.

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?

An output schema exists so return values need no explanation, parameters are fully covered, and the alternative tool is named. The remaining gap is failure behavior (no matching line found) for a destructive, file-mutating operation, which an agent would benefit from knowing.

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?

Schema coverage is 100%, so both parameters are already documented, but the description adds non-obvious semantics the schema lacks: matching is by text with surrounding whitespace stripped. The example import_text="import os" also clarifies the expected string form, which goes beyond 'Exact import line to remove' in the schema.

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?

States a specific verb (Remove) and resource (an import line) plus the matching rule (text with surrounding whitespace stripped). It also names the sibling it is not (remove_import_name), so an agent can distinguish the two without inspecting either schema.

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: removing an unused import' and 'Don't use this when: removing one name from a multi-name import (remove_import_name)' gives both the trigger condition and the named alternative. That is exactly the routing information needed among the 28 sibling tools.

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