Skip to main content
Glama

get_import_graph

Read-onlyIdempotent

Show file-level dependency graph by revealing what a file imports and what imports it, enabling understanding of module dependencies.

Instructions

Show file-level dependency graph: what a file imports and what imports it (requires reindex for ESM edge resolution). Use to understand module dependencies for a specific file. For project-wide coupling analysis use get_coupling; for visual diagram use get_dependency_diagram. Read-only. Returns JSON: { file, imports: [{ path }], importedBy: [{ path }] }.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_pathYesRelative file path to analyze (e.g. "src/server.ts")
Behavior5/5

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

Adds the important behavioral note that ESM edge resolution requires reindex, and describes the exact return format (JSON with file, imports, importedBy). Annotations already cover read-only and idempotent, and description reinforces without contradiction.

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?

Three sentences, each serving a distinct purpose: stating function, advising usage, and directing to alternatives. No redundant or 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?

For a single-parameter, read-only tool with clear annotations, the description covers purpose, usage context, limitations, and output format, leaving no obvious gaps.

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?

The schema has 100% coverage with a description for file_path. The tool description does not add additional parameter details beyond what the schema provides, so baseline 3 is appropriate.

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?

Description clearly states the tool shows file-level dependency graphs, specifying what a file imports and what imports it. It distinguishes from siblings like get_coupling and get_dependency_diagram by noting their different scopes.

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 (for specific file dependencies) and when not to (for project-wide coupling or visual diagrams), naming alternative tools.

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/nikolai-vysotskyi/trace-mcp'

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