analyze_imports
Find what imports a file, detect unused exports, and identify circular dependencies by analyzing import/export relationships. Uses a cached graph for fast repeated queries.
Instructions
Analyze import/export relationships for a file. Find what imports this file (importedBy), detect unused exports, and circular dependencies. Uses cached import graph for fast subsequent queries. Returns summary + limited results.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Max results per category (default: 10, max: 50) | |
| exclude | No | File patterns to exclude | |
| include | No | File patterns to include | |
| filePath | Yes | File to analyze (relative to project root) | |
| direction | No | What to analyze: imports (what this file imports), importedBy (what imports this file), or both (default: both) | |
| projectPath | Yes | Root path of the project | |
| includeUnused | No | Include unused exports analysis - exports not imported by any file in the project (default: true) | |
| detectCircular | No | Detect circular dependencies involving this file (default: true) |