Tools
index_workspace
Eagerly prepare structural analysis for broad work across an active workspace.
index_workspace scans an active workspace up front so broad semantic queries can use prepared roots, symbols, and outlines. It is an explicit, resource-intensive preparation step; most focused tasks do not need it because semantic tools index lazily.
Use when
- Repeated broad workspace queries are being delayed by first-use indexing.
- You want to prepare non-ignored files, project roots, workspace symbols, and supported-language outlines before a broad investigation.
Do not use when
- A focused semantic request can build the needed analysis lazily.
- You are trying to reload configuration or recover an unhealthy language server.
Request
{}Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
workspace_root | string | null | No | Absolute workspace root or file:// URI. If omitted, the sole active workspace is used; with multiple active workspaces, specify it. |
What it returns
The workspace is scanned for non-ignored files, project roots are discovered, relevant language servers are started, workspace symbols are collected where supported, and document outlines are cached where supported. Indexing can consume significant CPU, memory, and time.
Common mistakes
- Calling it for every small query instead of relying on lazy analysis.
- Omitting
workspace_rootwhen multiple workspaces are active. - Treating completion as proof that every language server or language feature supports workspace-wide symbols and outlines.
Related tools
initialize_workspaceactivates another workspace.outlinereads a known file's structure without requiring eager indexing.reload_configapplies configuration changes before indexing again.