Skip to main content
Glama

stats

View memory health statistics by category to monitor active, fading, and dead memories in AI agents.

Instructions

Memory health overview: active, fading, and dead memories by category.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function 'handleStats' which computes memory statistics (active/fading/dead counts and category distributions).
    function handleStats() {
      const memories = loadMemories();
      const now = Date.now();
    
      let active = 0, fading = 0, dead = 0;
      const categories = {};
    
      for (const m of memories) {
        const rel = computeRelevance(m, now);
        if (rel.status === 'ACTIVE') active++;
        else if (rel.status === 'FADING') fading++;
        else dead++;
    
        categories[m.category] = (categories[m.category] || 0) + 1;
      }
    
      return {
        total: memories.length,
        active,
        fading,
        dead,
        categories,
        health: dead > active ? 'NEEDS PRUNING' : active > 0 ? 'HEALTHY' : 'EMPTY',
        store_path: STORE_FILE,
      };
    }
  • The MCP tool definition for 'stats', including its description and schema.
      name: 'stats',
      description: 'Memory health overview: active, fading, and dead memories by category.',
      inputSchema: { type: 'object', properties: {} }
    }
  • index.js:467-467 (registration)
    The registration/dispatch logic within the 'tools/call' handler that maps the 'stats' name to the 'handleStats' function.
    case 'stats': result = handleStats(); break;
Behavior3/5

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

With no annotations provided, the description carries full burden. It adds valuable behavioral context by disclosing the three memory states (active, fading, dead) and categorization system. However, it omits safety information (read-only status), side effects, or rate limits that would be essential for a mutation-free tool.

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?

Single sentence of nine words with zero waste. Front-loaded with the core concept ('Memory health overview') followed by specific taxonomic details. Every word earns its place.

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

Completeness3/5

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

Given zero parameters and moderate conceptual complexity, the description adequately supports tool selection by indicating aggregate reporting scope. However, without output schema or annotations, it should explicitly state this is a safe read-only operation and hint at return structure (counts? percentages?)

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?

Input schema has zero parameters, establishing baseline 4. The description implicitly confirms no filtering or configuration is needed by presenting the tool as a comprehensive overview, consistent with the empty schema.

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?

Clearly identifies the resource (memory health) and scope (active, fading, dead categories by category), distinguishing it from action-oriented siblings like 'forget', 'prune', or 'remember'. However, uses noun phrase 'overview' rather than an explicit verb like 'Returns' or 'Provides'.

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 versus siblings like 'inspect' (which likely retrieves specific memories) or in what workflow context to check memory health statistics. Lacks explicit when-not-to-use or prerequisites.

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

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