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
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/git-utils.ts:162-194 (handler)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: {} } },
- src/index.ts:924-932 (handler)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)}` }] }; }
- src/index.ts:760-763 (schema)Input schema definition for the tool (empty object, no required parameters).inputSchema: { type: 'object', properties: {} }