Skip to main content
Glama

add_import_name

Add a name to an existing named import statement. Use when the module is already imported and you need to import an additional symbol.

Instructions

Add a name to an existing named-import statement. Idempotent: skips if the name is already present.

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

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

Use this when: The module is already imported via a named-import form and you want to add another name to that existing statement. Don't use this when: The import statement doesn't exist yet -> use add_import. You want a default or namespace import (import Foo from ... or import * as ns from ...) -> use add_import with the full line.

Example (Python): module="typing" name="Optional" Example (TS): module="./utils" name="baz"

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?

The description declares idempotency ('skips if the name is already present'), which is a key behavioral trait. It also gives language-specific examples (Python, JS/TS). With no annotations, the description covers the essential safety property well, though it does not mention error conditions or side effects.

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, uses bullet points for language-specific syntax, and front-loads the core action and idempotency. Every sentence adds value, with no wasted words.

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?

Given the tool's simplicity and the presence of an output schema (not shown), the description covers the main functionality, idempotency, and usage boundaries. It does not detail return values or error messages, but those may be in the output schema. Overall, it is sufficiently complete for this tool.

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

Parameters2/5

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

The input schema has 0% description coverage, and the description adds only minimal context beyond parameter names. Examples show plausible values (e.g., module='typing', name='Optional') but do not explain constraints, formats, or relationships between parameters. For 3 required string parameters, more guidance is expected.

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 action: 'Add a name to an existing named-import statement.' It identifies the specific verb (add) and resource (import name), and distinguishes from sibling tools like 'add_import' and 'remove_import_name' by focusing on adding a single name to an existing import.

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?

The description provides explicit when-to-use and when-not-to-use guidance, including alternative tools ('add_import') and scenarios (default vs. namespace imports). This helps the AI agent decide correctly.

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