Skip to main content
Glama

get_cache_stats

Retrieve statistics about query cache performance and usage to monitor memory management effectiveness.

Instructions

獲取查詢緩存統計信息

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • src/index.js:197-205 (registration)
    Registers the get_cache_stats tool with empty input schema, system scope, and a handler that delegates to queryCache.getStats() for retrieving query cache statistics.
    registerTool({
      name: 'get_cache_stats',
      description: '獲取查詢緩存統計信息',
      inputSchema: z.object({}),
      scope: 'system',
      async handler() {
        return queryCache.getStats();
      }
    }, 'system');
  • The getStats() method of QueryCache class that returns detailed statistics including hits, misses, hit rate, current size, and maximum size.
    getStats() {
      const total = this.hits + this.misses;
      const hitRate = total > 0 ? (this.hits / total * 100).toFixed(2) : 0;
    
      return {
        hits: this.hits,
        misses: this.misses,
        total,
        hitRate: `${hitRate}%`,
        size: this.cache.size,
        maxSize: this.maxSize
      };
    }
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. While '獲取' (get) implies a read operation, the description doesn't specify whether this requires special permissions, whether it returns real-time or historical data, what format the statistics come in, or whether there are rate limits. For a statistical retrieval tool with zero annotation coverage, this represents significant behavioral gaps.

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 is a single, efficient phrase that communicates the core function without unnecessary words. It's appropriately sized for a simple retrieval tool and front-loads the essential information. Every character earns its place in this minimal but complete phrase.

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 tool's statistical nature and lack of both annotations and output schema, the description is insufficiently complete. It doesn't explain what kind of statistics are returned (hit rates, size, eviction metrics), whether the data is aggregated or detailed, or what format the output takes. For a statistical tool in a memory/cache system context, more detail about the nature of the statistics would be helpful.

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 tool has zero parameters, and schema description coverage is 100% (though trivial since there are no parameters). The description doesn't need to explain any parameters, and the baseline for zero-parameter tools is 4. The description appropriately doesn't mention parameters since none exist.

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 query cache statistics) clearly states the verb ('獲取' - get) and resource ('查詢緩存統計信息' - query cache statistics), establishing the tool's basic purpose. However, it doesn't differentiate from sibling tools like 'get_memory_stats' or 'get_metrics' that also retrieve statistical information, leaving ambiguity about when this specific cache-focused tool should be used versus other stat-related tools.

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. With multiple sibling tools that retrieve statistics (get_memory_stats, get_metrics), there's no indication of what makes this cache-specific tool distinct or when it should be preferred over other statistical retrieval tools. The description offers only the basic function without contextual usage information.

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

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