Skip to main content
Glama

read_imports

Read-only

Returns only a source file's import statements, includes, or Ruby requires so you can inspect dependencies before editing imports.

Instructions

Return the import statements of a source file (imports, includes, Ruby requires), without reading the rest. Read-only.

Use this when: checking a file's dependencies, as before add_import. Don't use this when: changing imports (add_import, remove_import).

Example: file_path="/abs/path/to/module.py"

Input Schema

NameRequiredDescriptionDefault
file_pathYesAbsolute path to the source or config file.

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv3.2.0
    • addedInput schema / properties / file_path / description
      Added value: +"Absolute path to the source or config file."
  2. First observedv2.0.1

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, so the 'Read-only' line is redundant, but the description adds genuine behavioral context: it returns only the import section 'without reading the rest' of the file, implying a cheaper partial read. That is useful beyond the annotation set, though nothing is said about edge cases like files with no imports.

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?

Well front-loaded with purpose first, then usage routing, then example. The standalone 'Read-only.' sentence is largely waste given the annotations, but overall it is tight.

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?

An output schema exists so return values needn't be described, the single parameter is fully documented, and the read-only nature is covered by both annotations and text. Nothing an agent needs to invoke it correctly is missing.

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 100% and the single parameter is already documented as an absolute path, so the schema does the heavy lifting. The example is essentially a restatement of that guidance, adding minimal semantic value beyond the structured field.

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 and resource ('Return the import statements of a source file') and clarifies scope by naming the supported forms (imports, includes, Ruby requires). It is immediately distinguishable from siblings like add_import and remove_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?

Explicitly gives a 'Use this when' condition (checking dependencies, before add_import) and a 'Don't use this when' exclusion routing to add_import/remove_import. No inference required.

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