get_cache_stats
Retrieve cache statistics to monitor and analyze data storage efficiency within the Memory Cache Server, optimizing token usage during language model interactions.
Instructions
Get cache statistics
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:230-240 (handler)MCP tool handler for get_cache_stats: retrieves stats from CacheManager and returns formatted JSON.case 'get_cache_stats': { const stats = this.cacheManager.getStats(); return { content: [ { type: 'text', text: JSON.stringify(stats, null, 2), }, ], }; }
- src/index.ts:148-155 (registration)Tool registration in listTools handler, defining name, description, and empty input schema.{ name: 'get_cache_stats', description: 'Get cache statistics', inputSchema: { type: 'object', properties: {}, }, },
- src/CacheManager.ts:107-109 (helper)Core helper method that provides the cache statistics used by the tool handler.getStats(): CacheStats { return { ...this.stats }; }