Skip to main content
Glama

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
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • 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: {} } },
  • 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' }] }; }
  • Input schema definition for the tool (no required parameters).
    inputSchema: { type: 'object', properties: {} }
  • 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); } } }

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/keleshteri/mcp-memory'

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