list_history_files
Retrieve a list of files with local history entries in VS Code for recovery or context awareness using the Local History MCP Server.
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 handler function that retrieves all file histories using VSCodeHistoryParser, constructs a list with file paths, entry counts, and last modified timestamps, and returns a formatted text response listing the files with history.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:53-61 (schema)Tool schema definition: name 'list_history_files', description, and input schema as empty object (no parameters required).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)Registration in the CallToolRequestSchema handler switch statement, which routes calls to the 'list_history_files' tool to the listHistoryFiles() method.case 'list_history_files': return await this.listHistoryFiles();