reinitialize_indexer
Refresh TypeScript type definitions after installing packages to ensure accurate interface discovery and type-safe mock generation.
Instructions
Reinitialize the type indexer (useful after package installations)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| workingDir | No | Optional working directory to reinitialize from |
Implementation Reference
- src/mcp-server.ts:395-418 (handler)The handler function that executes the reinitialize_indexer tool logic. It optionally updates the working directory and config, then calls the typeIndexer.initialize() method, returning a success message.private async handleReinitializeIndexer(workingDir?: string) { try { if (workingDir) { this.config = WorkspaceDetector.detectProjectConfig(workingDir); this.typeIndexer = new TypeIndexer(this.config); } await this.typeIndexer.initialize(); return { content: [ { type: "text", text: JSON.stringify({ message: "Type indexer reinitialized successfully", config: this.config }, null, 2) } ] }; } catch (error) { throw new Error(`Failed to reinitialize indexer: ${error instanceof Error ? error.message : String(error)}`); } }
- src/mcp-server.ts:189-202 (registration)Registration of the reinitialize_indexer tool in the ListTools response, including name, description, and input schema definition.{ name: "reinitialize_indexer", description: "Reinitialize the type indexer (useful after package installations)", inputSchema: { type: "object", properties: { workingDir: { type: "string", description: "Optional working directory to reinitialize from" } }, additionalProperties: false } }
- src/mcp-server.ts:252-255 (registration)The switch case in CallToolRequest handler that routes the reinitialize_indexer tool call to the handleReinitializeIndexer method after argument validation.case "reinitialize_indexer": { const reinitArgs = this.validateArgs<ToolArguments["reinitialize_indexer"]>(args); return await this.handleReinitializeIndexer(reinitArgs.workingDir); }
- src/mcp-server.ts:26-26 (schema)TypeScript interface definition for the tool arguments used in validateArgs for type safety.reinitialize_indexer: { workingDir?: string };