Skip to main content
Glama

update_all_last_editors

Update @last-editor fields in all files using Git author information to maintain accurate contributor tracking.

Instructions

Update @last-editor fields in all files with Git author information

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Core handler function that scans all .ts files, checks for @last-editor, updates them using git history via updateLastEditorInFile, and returns results for each file.
    async updateAllLastEditors(): Promise<Array<{file: string, success: boolean, newEditor?: string, reason?: string}>> {
      try {
        // Find all TypeScript files with @last-editor
        const pattern = path.join(this.projectRoot, '**/*.ts');
        const files = glob.sync(pattern, { ignore: ['**/node_modules/**', '**/dist/**'] });
        
        const results = [];
        
        for (const file of files) {
          try {
            const content = await fs.readFile(file, 'utf8');
            if (content.includes('@last-editor')) {
              const result = await this.updateLastEditorInFile(file);
              results.push({
                file: path.relative(this.projectRoot, file),
                ...result
              });
            }
          } catch (error) {
            results.push({
              file: path.relative(this.projectRoot, file),
              success: false,
              reason: `Error reading file: ${error}`
            });
          }
        }
        
        return results;
      } catch (error) {
        console.error('Error updating all last editors:', error);
        return [{ file: 'all', success: false, reason: `Error: ${error}` }];
      }
    }
  • src/index.ts:757-764 (registration)
    Tool registration in the MCP server's tools list, defining name, description, and empty input schema (no parameters required).
    {
      name: 'update_all_last_editors',
      description: 'Update @last-editor fields in all files with Git author information',
      inputSchema: {
        type: 'object',
        properties: {}
      }
    },
  • MCP tool request handler case that invokes gitUtils.updateAllLastEditors(), computes summary statistics, and returns formatted response.
    case 'update_all_last_editors': {
      const results = await this.gitUtils.updateAllLastEditors();
      const summary = {
        updated: results.filter(r => r.success).length,
        skipped: results.filter(r => !r.success).length,
        details: results
      };
      return { content: [{ type: 'text', text: `Updated ${summary.updated} files, skipped ${summary.skipped} files. Details: ${JSON.stringify(summary.details, null, 2)}` }] };
    }
  • Input schema definition for the tool (empty object, no required parameters).
    inputSchema: {
      type: 'object',
      properties: {}
    }

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