build_index
Scan PHP files to build a persistent symbol index, enabling instant symbol lookup without re-scanning. Supports incremental updates for changed files.
Instructions
Scan PHP files and build (or update) the symbol index.
The index stores all classes, interfaces, traits, enums, and their methods so that find_symbol can locate any symbol instantly without re-scanning.
The index is persisted to /.symfony-mcp-index.json and loaded automatically on next server start. Only changed files are re-scanned (incremental), so subsequent calls are fast.
Args: directories: Directories to scan, relative to the project root. Default: auto-detected (src/, app/, lib/). Example: ["src", "lib"] force: Re-scan every file even if it hasn't changed. Use this after a major refactor or rename.
Run this once after pointing the server at a new project, then again after significant code changes.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| directories | No | ||
| force | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |