clear_cache
Clear cached repository index to resolve corruption issues or force a fresh index for accurate code navigation and retrieval.
Instructions
Clear the cached index for a repository. Useful if cache becomes corrupted or you want to force a fresh index.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | No | Path to repository root. Default: process.cwd() |
Implementation Reference
- src/indexer.ts:1046-1052 (handler)The clearCache method inside Indexer class which removes the cache file for a given repository path.
async clearCache(rootPath: string): Promise<void> { try { const cachePath = this.getCachePath(rootPath); await fs.unlink(cachePath); console.error('Cache cleared'); } catch (error) { // Cache file doesn't exist or can't be deleted - src/index.ts:387-389 (registration)Tool execution handler in the main MCP server loop.
case 'clear_cache': { const path = (args as any).path || process.cwd(); await indexer.clearCache(path);