Skip to main content
Glama
tosin2013

Memory Cache Server

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;
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. 'Get cache statistics' implies a read-only operation, but it doesn't specify aspects like whether it requires authentication, has rate limits, returns real-time or aggregated data, or what format the statistics are in. The description is too minimal to provide meaningful behavioral context beyond the basic action.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description 'Get cache statistics' is extremely concise—three words that directly state the action. It's front-loaded with no unnecessary words or sentences, making it efficient and easy to parse. This is an example of optimal conciseness for a simple tool.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the lack of annotations and output schema, the description is incomplete for a tool that likely returns data (statistics). It doesn't explain what statistics are retrieved (e.g., hit rates, memory usage), the return format, or any behavioral nuances. For a tool with potential complexity in output, this minimal description leaves significant gaps in understanding.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 0 parameters with 100% coverage, meaning no parameters are documented in the schema. The description doesn't add parameter details, which is appropriate since there are no parameters. This aligns with the baseline of 4 for zero parameters, as no additional semantic information is needed.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Get cache statistics' states a clear verb ('Get') and resource ('cache statistics'), which is adequate for understanding the basic purpose. However, it doesn't differentiate this tool from its siblings (e.g., clear_cache, retrieve_data, store_data), making it somewhat vague in comparison. It's not tautological but lacks specificity about what statistics are retrieved.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like clear_cache or retrieve_data. There's no mention of context, prerequisites, or exclusions, leaving the agent to infer usage based on the name alone. This lack of explicit guidance reduces its effectiveness in tool selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

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

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