Skip to main content
Glama
xxczaki
by xxczaki

get_history_stats

Retrieve detailed statistics on local file history, including total files and entries, to enhance context awareness and track version history efficiently.

Instructions

Get statistics about the local history (total files, entries, etc.)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for the 'get_history_stats' tool. It calls the history parser to get stats and formats a textual response with the statistics.
    private async getHistoryStats() { const stats = this.historyParser.getHistoryStats(); return { content: [ { type: 'text', text: '📊 Local History Statistics\n\n' + `History directory: ${stats.historyDirPath}\n` + `Directory exists: ${stats.historyDirExists ? '✅' : '❌'}\n` + `Total files with history: ${stats.totalFiles}\n` + `Total history entries: ${stats.totalEntries}\n` + `Average entries per file: ${stats.totalFiles > 0 ? (stats.totalEntries / stats.totalFiles).toFixed(1) : 'N/A'}`, }, ], }; }
  • Input schema definition for the 'get_history_stats' tool, specifying no required parameters.
    inputSchema: { type: 'object', properties: {}, additionalProperties: false, },
  • src/index.ts:127-136 (registration)
    Tool registration in the ListToolsRequestHandler response, including name, description, and input schema.
    { name: 'get_history_stats', description: 'Get statistics about the local history (total files, entries, etc.)', inputSchema: { type: 'object', properties: {}, additionalProperties: false, }, },
  • Supporting method in VSCodeHistoryParser that computes the actual history statistics by iterating over all file histories.
    public getHistoryStats(): { totalFiles: number; totalEntries: number; historyDirExists: boolean; historyDirPath: string; } { const histories = this.getAllFileHistories(); const totalEntries = histories.reduce( (sum, history) => sum + history.entries.length, 0, ); return { totalFiles: histories.length, totalEntries, historyDirExists: this.historyDirectoryExists(), historyDirPath: this.historyDir, }; }

Other Tools

Related Tools

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/xxczaki/local-history-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server