Skip to main content
Glama

get_memory_health

Check memory system health statistics for AI systems to monitor data storage performance and continuity.

Instructions

Get overall statistics about memory system health

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The getMemoryHealth() method that retrieves memory health statistics from the database view
    async getMemoryHealth() {
      try {
        const health = await this.db
          .select()
          .from(schema.memoryHealth);
    
        return health;
      } catch (error) {
        console.error('Error getting memory health:', error);
        throw error;
      }
    }
  • Tool registration schema defining name, description, and input parameters for get_memory_health
    name: "get_memory_health",
    description: "Get overall statistics about memory system health",
    inputSchema: {
      type: "object",
      properties: {}
    }
  • Database view definition that aggregates memory health statistics by type (total memories, avg importance, avg access count, etc.)
    export const memoryHealth = pgView("memory_health", {	type: memoryType(),
    	// You can use { mode: "bigint" } if numbers are exceeding js number limitations
    	totalMemories: bigint("total_memories", { mode: "number" }),
    	avgImportance: doublePrecision("avg_importance"),
    	avgAccessCount: numeric("avg_access_count"),
    	// You can use { mode: "bigint" } if numbers are exceeding js number limitations
    	accessedLastDay: bigint("accessed_last_day", { mode: "number" }),
    	avgRelevance: doublePrecision("avg_relevance"),
    }).as(sql`SELECT type, count(*) AS total_memories, avg(importance) AS avg_importance, avg(access_count) AS avg_access_count, count(*) FILTER (WHERE last_accessed > (CURRENT_TIMESTAMP - '1 day'::interval)) AS accessed_last_day, avg(relevance_score) AS avg_relevance FROM memories GROUP BY type`);
  • mcp.js:199-205 (registration)
    MCP server tool listing registration for get_memory_health
      name: "get_memory_health",
      description: "Get overall statistics about memory system health",
      inputSchema: {
        type: "object",
        properties: {}
      }
    },
  • mcp.js:593-595 (registration)
    MCP request handler that routes get_memory_health calls to memoryManager.getMemoryHealth()
    case "get_memory_health":
      const health = await memoryManager.getMemoryHealth();
      return { content: [{ type: "text", text: JSON.stringify(health, null, 2) }] };

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

B3.2/5.0
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-only operation, it doesn't specify whether this requires special permissions, what format the statistics are returned in, whether there are rate limits, or if the operation has any side effects. For a diagnostic tool with zero annotation coverage, this leaves significant behavioral questions unanswered.

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 perfectly concise - a single sentence that directly states the tool's purpose without any unnecessary words. It's front-loaded with the core functionality and doesn't include any extraneous information. Every word earns its place in this minimal but complete statement.

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 the tool's simplicity (no parameters, no output schema), the description is adequate but minimal. For a diagnostic/health-check tool, it could benefit from mentioning what specific statistics are included or the format of the response. However, with no complex parameters and no output schema to document, the description meets minimum viable standards.

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 appropriately doesn't waste space discussing parameters that don't exist. A baseline of 4 is appropriate for zero-parameter tools when the description focuses on what the tool does rather than parameter documentation.

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?

The description clearly states the tool's purpose with a specific verb ('Get') and resource ('overall statistics about memory system health'), making it immediately understandable. However, it doesn't differentiate this tool from sibling tools like 'get_cluster_insights' or 'get_active_themes' that also retrieve health/status information, which prevents a perfect score.

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 many sibling tools that retrieve various types of memory information (clusters, relationships, history, etc.), there's no indication of when 'memory system health' statistics are appropriate versus other diagnostic or informational tools.

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