list_history_files
Retrieve files with saved history entries in VS Code to enable version recovery and track changes over time.
Instructions
List all files that have local history entries in VS Code
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:274-300 (handler)The main handler function for 'list_history_files' tool. It fetches all file histories from the VSCodeHistoryParser, constructs a list with file paths, entry counts, and last modified times, and returns a formatted text response.private async listHistoryFiles() { const histories = this.historyParser.getAllFileHistories(); const fileList = histories.map((history) => ({ filePath: history.originalFilePath, entryCount: history.entries.length, lastModified: new Date(history.entries[0]?.timestamp || 0).toISOString(), })); return { content: [ { type: 'text', text: `Found ${fileList.length} files with local history:\n\n` + fileList .map( (file) => `📄 ${file.filePath}\n` + ` └── ${file.entryCount} history entries\n` + ` └── Last saved: ${file.lastModified}`, ) .join('\n\n'), }, ], }; }
- src/index.ts:56-60 (schema)Input schema for the 'list_history_files' tool, which takes no parameters (empty object).inputSchema: { type: 'object', properties: {}, additionalProperties: false, },
- src/index.ts:52-61 (registration)Registration of the 'list_history_files' tool in the ListToolsRequestSchema handler response, including name, description, and input schema.{ name: 'list_history_files', description: 'List all files that have local history entries in VS Code', inputSchema: { type: 'object', properties: {}, additionalProperties: false, }, },
- src/index.ts:167-168 (registration)Dispatch case in the CallToolRequestSchema handler that routes calls to 'list_history_files' to the listHistoryFiles method.case 'list_history_files': return await this.listHistoryFiles();