Skip to main content
Glama

get_dependencies_with_depth

Retrieve file dependencies up to a chosen depth in the import graph, either downstream imports or upstream importers, and return each file with its distance from the target.

Instructions

Gets file dependencies up to specified depth in the import graph.

Args:
    file_path: File path relative to project root
    depth: How many levels deep to traverse (1-5, default 2)
    direction: "downstream" (what it imports) or "upstream" (what imports it)

Returns:
    List of files with their distance from the target file

Input Schema

NameRequiredDescriptionDefault
depthNo
directionNodownstream
file_pathYes

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.12.0

TDQS

A3.9/5.0
Behavior3/5

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

No annotations are provided, so the description carries the full behavioral burden. It clearly indicates a read-style retrieval operation and explains depth and direction, but it does not mention error handling, performance characteristics, or explicit read-only/safety behavior.

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 and well-structured with Args and Returns sections. It front-loads the core purpose and uses every line to convey relevant invocation details without unnecessary verbosity.

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?

The tool is moderately complex with three parameters and an import-graph traversal. The description covers purpose, all parameters, and return semantics, and an output schema exists so return values need not be detailed further. It lacks only explicit routing guidance versus sibling dependency tools.

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

Parameters5/5

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

Schema description coverage is 0%, so the description must document parameter meaning. It does so for all three parameters: file_path is relative to project root, depth is 1-5 with default 2, and direction is downstream or upstream with clear definitions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb and resource: getting file dependencies in the import graph up to a specified depth. It is clear what the tool does, but it does not explicitly distinguish itself from sibling dependency tools such as get_file_relations, check_dependencies, or find_dependency_path.

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

Usage Guidelines3/5

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

Usage is implied through the direction parameter, which explains downstream vs upstream traversal, and the depth range. However, the description does not explicitly say when to choose this tool over alternatives like check_dependencies or find_dependency_path.

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