Stellarion
Tools

stellarion_find_by_imports

Find all files that import a given module or package

Searches the dependency graph for files that import a specific module. Useful for understanding how a module is consumed across the codebase, assessing the impact of changing a module's API, or finding usage patterns.

When to Use

  • You want to know which files depend on a specific module before changing its exports
  • You need to find all consumers of a library or internal package
  • You are deprecating a module and need to find everything that still imports it
  • You want to understand adoption of a new module across the codebase

Parameters

ParameterTypeRequiredDefaultDescription
moduleNamestringyesModule name or path to search for (e.g., lodash, @/utils/format, std::collections)
matchModeenumnocontainsHow to match: exact, prefix, contains, fuzzy
limitnumberno50Maximum number of results

Examples

Find all files importing a utility module

Natural language:

Which files import from @/utils/validation?

MCP call:

{
  "tool": "stellarion_find_by_imports",
  "arguments": {
    "moduleName": "@/utils/validation",
    "matchMode": "exact"
  }
}

Find all usage of a third-party library

Natural language:

Find every file that imports anything from axios

MCP call:

{
  "tool": "stellarion_find_by_imports",
  "arguments": {
    "moduleName": "axios",
    "matchMode": "prefix"
  }
}

Fuzzy search for a module

Natural language:

Find files importing anything related to "serde" in this Rust project

MCP call:

{
  "tool": "stellarion_find_by_imports",
  "arguments": {
    "moduleName": "serde",
    "matchMode": "contains"
  }
}

Output Format

Returns a list of importing files:

  • uri — File path of the importing file
  • importStatement — The actual import/use/require statement
  • line — Line number of the import

Tips

  • Use matchMode: "exact" when searching for a specific module path to avoid false positives.
  • Use matchMode: "prefix" for packages with sub-modules (e.g., "react" matches react, react-dom, react/jsx-runtime).
  • Use matchMode: "contains" when you're not sure of the full path.
  • Combine with stellarion_analyze_impact to understand the cascading effect of changing a module.