generate_all_folder_maps
Create _map.md files for every folder in a project to enhance project awareness and structured file management with the MCP Memory Server.
Instructions
Generate _map.md files for all folders in the project
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/folder-mapper.ts:101-111 (handler)The primary handler function that generates folder maps for all eligible folders in the src directory by recursively calling generateFolderMapsRecursively.async generateAllFolderMaps(): Promise<void> { const srcDir = path.join(this.projectRoot, 'src'); if (!await fs.pathExists(srcDir)) { console.log(chalk.yellow('⚠️ No src directory found')); return; } await this.generateFolderMapsRecursively(srcDir); console.log(chalk.green('✅ All folder maps generated successfully')); }
- src/index.ts:737-743 (registration)MCP tool registration including name, description, and input schema (empty object since no parameters required).name: 'generate_all_folder_maps', description: 'Generate _map.md files for all folders in the project', inputSchema: { type: 'object', properties: {} } },
- src/index.ts:908-911 (handler)Dispatch handler in the MCP CallToolRequestSchema switch statement that invokes the FolderMapper's generateAllFolderMaps method.case 'generate_all_folder_maps': { await this.folderMapper.generateAllFolderMaps(); return { content: [{ type: 'text', text: 'All folder maps generated successfully' }] }; }
- src/index.ts:739-742 (schema)Input schema definition for the tool (no required parameters).inputSchema: { type: 'object', properties: {} }
- src/folder-mapper.ts:214-230 (helper)Key helper method that recursively generates folder maps for subdirectories containing code files.private async generateFolderMapsRecursively(dirPath: string): Promise<void> { const entries = await fs.readdir(dirPath, { withFileTypes: true }); const hasCodeFiles = await this.hasCodeFiles(dirPath); // Generate map for current folder if it has code files if (hasCodeFiles) { await this.generateFolderMap(dirPath); } // Recursively process subdirectories for (const entry of entries) { if (entry.isDirectory() && !this.shouldExcludeFolder(entry.name)) { const subDirPath = path.join(dirPath, entry.name); await this.generateFolderMapsRecursively(subDirPath); } } }