get_file_changelog
Track and retrieve changelog entries for a specific file on the MCP Memory Server, ensuring transparency and history of modifications during coding sessions.
Instructions
Get changelog entries for a specific file
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filePath | Yes | Path to the file |
Implementation Reference
- src/index.ts:703-712 (registration)Tool registration in the listTools response, defining name, description, and input schema for get_file_changelog.name: 'get_file_changelog', description: 'Get changelog entries for a specific file', inputSchema: { type: 'object', properties: { filePath: { type: 'string', description: 'Path to the file' } }, required: ['filePath'] } },
- src/index.ts:889-893 (handler)MCP CallToolRequest handler that calls ChangelogManager.getChangelogForFile with the provided filePath and returns the result as JSON string.case 'get_file_changelog': { const filePath = args.filePath as string; const fileChangelog = await this.changelogManager.getChangelogForFile(filePath); return { content: [{ type: 'text', text: JSON.stringify(fileChangelog, null, 2) }] }; }
- src/changelog-manager.ts:82-89 (helper)Implementation logic in ChangelogManager that retrieves full changelog, computes relative file path, and filters entries where the file appears in filesChanged array.async getChangelogForFile(filePath: string): Promise<ChangelogEntry[]> { const changelog = await this.getChangelog(); const relativePath = path.relative(this.projectRoot, filePath); return changelog.filter(entry => entry.filesChanged.some(file => file === relativePath) ); }