Stellarion
Tools

stellarion_index_directory

Add a directory to the code graph alongside existing indexed data

Indexes all supported files in a directory, adding them to the existing code graph. Unlike stellarion_reindex_workspace which operates on the configured workspace root, this tool lets you add any directory — useful for monorepos, external dependencies, or directories outside the main project.

When to Use

  • You want to add a new sub-project or package to the graph in a monorepo
  • You need to index a directory outside the main workspace (e.g., a shared library)
  • You added a new top-level directory to the project and want it indexed
  • You want to include vendored or generated code in the graph

Parameters

ParameterTypeRequiredDefaultDescription
pathstringyesAbsolute path to the directory to index
embedbooleannotrueWhether to generate embeddings for semantic search (disable for faster indexing if you only need structural analysis)

Examples

Index a new package in a monorepo

Natural language:

Add the packages/shared-utils directory to the code graph

MCP call:

{
  "tool": "stellarion_index_directory",
  "arguments": {
    "path": "/Users/dev/monorepo/packages/shared-utils"
  }
}

Index without embeddings (faster)

Natural language:

Index the vendor directory but skip embedding generation — I just need the call graph

MCP call:

{
  "tool": "stellarion_index_directory",
  "arguments": {
    "path": "/Users/dev/project/vendor",
    "embed": false
  }
}

Index an external dependency for cross-project analysis

Natural language:

Add our shared library to the graph so I can trace cross-project calls

MCP call:

{
  "tool": "stellarion_index_directory",
  "arguments": {
    "path": "/Users/dev/shared-lib/src"
  }
}

Output Format

Returns indexing summary:

  • filesProcessed — Number of files parsed
  • symbolsIndexed — Number of symbols added to the graph
  • embeddingsGenerated — Number of embeddings created (if embed: true)
  • duration — Time taken
  • errors — Any files that failed to parse

Tips

  • The directory is added alongside existing data — it does not replace or clear the current graph.
  • Set embed: false when you only need structural analysis (call graphs, imports) and don't need semantic search. This significantly speeds up indexing.
  • For individual files, use stellarion_index_files instead.
  • The path must be absolute. Relative paths will not resolve correctly.
  • Large directories with thousands of files may take a minute or more to index, especially with embeddings enabled.