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
| Name | Required | Description | Default |
|---|---|---|---|
| direction | No | Direction to analyze - "dependencies", "dependents", or "both" (default: "dependencies") | dependencies |
| file_path | Yes | Path of the file to analyze (required) - e.g., "src/auth.ts" | |
| project_id | No | Project ID from create_project() (optional if project_name or workspace_path provided) | |
| project_name | No | Project name to look up (alternative to project_id) | |
| workspace_path | No | Workspace directory path (alternative to project_id) |