Skip to main content
Glama
ibproduct

Memory Cache MCP Server

by ibproduct

get_cache_stats

Retrieve statistics about cached data to monitor usage and optimize token efficiency in the Memory Cache MCP Server.

Instructions

Get cache statistics

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Handler for the 'get_cache_stats' tool call. Retrieves cache statistics using CacheManager.getStats() and returns them as formatted JSON text content.
    case 'get_cache_stats': { const stats = this.cacheManager.getStats(); return { content: [ { type: 'text', text: JSON.stringify(stats, null, 2), }, ], }; }
  • src/index.ts:148-156 (registration)
    Registration of the 'get_cache_stats' tool in the ListToolsRequestSchema handler, defining its name, description, and input schema (no required parameters).
    { name: 'get_cache_stats', description: 'Get cache statistics', inputSchema: { type: 'object', properties: {}, }, }, ],
  • TypeScript interface defining the structure of cache statistics returned by the get_cache_stats tool.
    export interface CacheStats { totalEntries: number; memoryUsage: number; hits: number; misses: number; hitRate: number; avgAccessTime: number; }
  • Helper method in CacheManager class that returns a shallow copy of the current cache statistics object.
    getStats(): CacheStats { return { ...this.stats }; }

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/ibproduct/ib-mcp-cache-server'

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