Skip to main content
Glama

get_dependency_graph

Returns the direct import graph for a file, showing both its dependencies and dependents to identify what the file imports and what imports it.

Instructions

Returns the direct import graph for a specific file: what it imports, and what imports it. Use to answer: what depends on this file? What does this file depend on?

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
formatNoOutput format — json (default) or mermaid flowchart diagramjson
file_pathYesPath to the file (absolute or relative to project_root)
project_rootYesAbsolute path to the TypeScript project root (must contain tsconfig.json)
Behavior3/5

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

With no annotations, the description carries the full burden of behavioral disclosure. It adds useful context by scoping to 'direct' imports (not transitive), but it does not mention error behavior, performance characteristics, or whether any state changes occur (though 'Returns' implies read-only). This is a minimal but not rich disclosure.

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 two sentences, front-loads the core action, and immediately provides practical use cases. Every word earns its place, with no fluff or redundancy.

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?

For a 3-parameter read tool with full schema coverage and no output schema, the description provides enough context: it states what the tool returns and the key questions it answers. It does not describe the exact JSON/mermaid structure, but the two-direction graph return is sufficiently outlined. It could mention edge cases, but overall completeness is good.

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 description coverage is 100%, so all three parameters already have descriptions. The tool description adds no extra parameter-level meaning beyond the schema; it only refers to 'a specific file' which is already captured in file_path. Thus the baseline of 3 applies.

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 names a specific verb ('Returns') and a specific resource ('direct import graph for a specific file'), and clarifies the two directions of the graph ('what it imports, and what imports it'). It clearly distinguishes this from sibling get_symbol_dependency_graph by emphasizing 'import graph' and 'direct'.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit use cases ('what depends on this file? What does this file depend on?'), giving the agent clear context for when to invoke this tool. However, it does not mention any alternatives or exclusions, such as when to prefer get_symbol_dependency_graph, so it lacks explicit when-not-to-use guidance.

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/vola-trebla/ast-impact-mapper-mcp'

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