Skip to main content
Glama
blakeyoder

TypeScript Definitions MCP Server

by blakeyoder

reinitialize_indexer

Restart the TypeScript type indexer to detect new dependencies after package installations, ensuring accurate type definition discovery.

Instructions

Reinitialize the type indexer (useful after package installations)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
workingDirNoOptional working directory to reinitialize from

Implementation Reference

  • The main execution logic for the 'reinitialize_indexer' tool. Updates project config if workingDir provided, recreates TypeIndexer, calls initialize(), and returns success response.
    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)}`); } }
  • Registers the tool in the ListTools response with name, description, and input schema.
    { 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 } }
  • TypeScript interface definition for the tool's input arguments, used for type-safe validation.
    reinitialize_indexer: { workingDir?: string };
  • Switch case in CallToolRequest handler that validates arguments using the schema and dispatches to the handler function.
    case "reinitialize_indexer": { const reinitArgs = this.validateArgs<ToolArguments["reinitialize_indexer"]>(args); return await this.handleReinitializeIndexer(reinitArgs.workingDir); }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/blakeyoder/typescript-definitions-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server