Skip to main content
Glama

get_file_dependencies

Analyze file dependencies and dependents to understand the impact of code changes. Use before editing or deleting files to identify potential breakage and refactoring risks.

Instructions

Analyze file dependencies to understand the impact of changes.

This tool provides flexible project lookup. You can specify any combination of identifiers, and it will resolve to the matching project.

Priority: project_id > workspace_path > project_name

WHEN TO USE:

  • Before modifying a file to see what else might break

  • When refactoring to understand the ripple effects

  • To find all files affected by a bug fix

  • To understand the codebase architecture and relationships

  • When deleting files to ensure nothing depends on them

  • To identify circular dependencies

IMPORTANT: This helps prevent breaking changes and understand refactoring impact. Always check dependencies before making significant modifications.

DIRECTIONS:

  • "dependencies": What this file imports/uses (downstream)

  • "dependents": What imports/uses this file (upstream) - USE THIS BEFORE DELETING

  • "both": Complete dependency graph in both directions

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
directionNoDirection to analyze - "dependencies", "dependents", or "both" (default: "dependencies")dependencies
file_pathYesPath of the file to analyze (required) - e.g., "src/auth.ts"
project_idNoProject ID from create_project() (optional if project_name or workspace_path provided)
project_nameNoProject name to look up (alternative to project_id)
workspace_pathNoWorkspace directory path (alternative to project_id)
Behavior4/5

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

No annotations are provided, so the description carries the full burden. It discloses key behavior: the direction parameter semantics ('dependencies': What this file imports/uses, 'dependents': What imports/uses this file) and the project lookup priority (project_id > workspace_path > project_name). It does not explicitly state that the operation is read-only, but the verb 'Analyze' implies it. Could add return format or potential errors, but it's not misleading.

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?

The description is well-structured with clear sections (WHEN TO USE, IMPORTANT, DIRECTIONS) and front-loaded with a one-sentence summary. It's slightly long but each section earns its place. The 'IMPORTANT' sentence somewhat restates the value proposition, making it mildly redundant, but overall it is scannable and efficient.

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 there is no output schema and no annotations, the description does a good job covering the tool's purpose, usage scenarios, direction semantics, and project lookup. The only gap is not describing the exact return format (e.g., list of paths vs. graph), but the phrase 'Complete dependency graph' hints at the output. For a 5-parameter tool, this is reasonably complete.

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?

While the input schema covers 100% of parameters, the description adds essential meaning beyond the schema. For example, the schema only lists 'dependencies', 'dependents', or 'both' for direction, but the description explains what each means in terms of downstream/upstream. It also clarifies how project_id, workspace_path, and project_name resolve, which the schema does not.

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 opens with a specific verb and resource: 'Analyze file dependencies to understand the impact of changes.' It clearly distinguishes itself from sibling tools by focusing on dependency analysis and even clarifies the direction parameter (dependencies vs. dependents vs. both), leaving no ambiguity about what the tool does.

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?

A dedicated 'WHEN TO USE' section lists concrete scenarios such as 'Before modifying a file to see what else might break' and 'When deleting files to ensure nothing depends on them.' This explicitly tells the agent when to invoke this tool, effectively differentiating it from alternatives like analyze_architecture or get_module_info.

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/siddiquesahabaj/CoordMCP'

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