Skip to main content
Glama
tosin2013

Memory Cache Server

by tosin2013

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;
    }

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

C2.9/5.0
Behavior2/5

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

No annotations provided; the description implies a read-only operation but does not explicitly state it. No details on side effects or prerequisites.

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

Conciseness3/5

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

Extremely concise (two words), but lacks detail on return value and usage context. Could be slightly expanded without losing conciseness.

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?

No output schema and no description of what statistics are returned. Incomplete for a tool that produces output.

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?

No parameters exist (100% schema coverage), so the description adds no parameter information but is not required to.

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

Purpose4/5

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

Description clearly states the tool retrieves cache statistics, distinguishing it from sibling tools like cached_commands and clear_command_cache. However, it does not specify what type of statistics (e.g., hit rate, size).

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?

No guidance on when to use this tool versus alternatives. The description gives no context or exclusions.

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

Deploy Server

Other Tools