Skip to main content
Glama

get_cache_stats

Retrieve performance metrics and usage data from the Memory Cache Server to monitor token optimization and cache efficiency during language model interactions.

Instructions

Get cache statistics

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Main handler for the 'get_cache_stats' tool: calls CacheManager.getStats() and formats response as JSON text.
    case 'get_cache_stats': { const stats = this.cacheManager.getStats(); return { content: [ { type: 'text', text: JSON.stringify(stats, null, 2), }, ], }; }
  • Core implementation: returns a shallow copy of the cache statistics object.
    getStats(): CacheStats { return { ...this.stats }; }
  • src/index.ts:149-155 (registration)
    Registers the 'get_cache_stats' tool in the MCP tools list with empty input schema (no parameters). Note: opening brace on line 148.
    name: 'get_cache_stats', description: 'Get cache statistics', inputSchema: { type: 'object', properties: {}, }, },
  • TypeScript interface defining the structure of cache statistics returned by the tool.
    export interface CacheStats { totalEntries: number; memoryUsage: number; hits: number; misses: number; hitRate: number; avgAccessTime: number; }

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/tosin2013/mcp-memory-cache-server'

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