Skip to main content
Glama
MikeyBeez

MCP Contemplation

by MikeyBeez

get_memory_stats

Retrieve memory usage statistics to monitor and analyze system performance within the MCP Contemplation server's cognitive processing environment.

Instructions

Get memory usage statistics

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The core handler function in ContemplationManager that computes and returns memory statistics including total insights, unused insights, high-significance insights, aggregated patterns, memory limit, significance threshold, and estimated context usage.
    getMemoryStats(): any {
      const total = this.insights.length;
      const unused = this.insights.filter(i => !i.used).length;
      const highSig = this.insights.filter(i => i.significance >= 8).length;
      const aggregated = this.insights.filter(i => i.similar_count && i.similar_count > 1).length;
      
      return {
        total_insights: total,
        unused_insights: unused,
        high_significance: highSig,
        aggregated_patterns: aggregated,
        memory_limit: this.maxInsightsInMemory,
        significance_threshold: this.significanceThreshold,
        estimated_context_usage: `${Math.round((total / this.maxInsightsInMemory) * 100)}%`
      };
    }
  • src/index.ts:449-456 (registration)
    Registers the 'get_memory_stats' tool in the ListTools response, defining its name, description, and empty input schema.
    {
      name: 'get_memory_stats',
      description: 'Get memory usage statistics',
      inputSchema: {
        type: 'object',
        properties: {},
      },
    },
  • The switch case in the CallToolRequestHandler that invokes the getMemoryStats handler and formats the response as MCP content.
    case 'get_memory_stats': {
      const stats = contemplation.getMemoryStats();
      return {
        content: [{ type: 'text', text: JSON.stringify(stats, null, 2) }],
      };
    }
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. It states it 'gets' statistics (implying read-only), but doesn't specify what statistics are returned, format, whether it requires permissions, or any side effects. This leaves significant gaps for a tool that presumably provides system metrics.

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 sentence that directly states the tool's purpose without any unnecessary words. It's perfectly front-loaded and wastes no space on irrelevant details.

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?

For a statistics-retrieval tool with no annotations and no output schema, the description is insufficient. It doesn't explain what specific memory statistics are returned, their format, or any behavioral context. Given the complexity of system metrics and lack of structured documentation, more detail 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 with 100% schema description coverage, so the schema already fully documents the parameter situation. The description appropriately doesn't mention parameters since none exist, maintaining focus on the tool's purpose.

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 verb ('Get') and resource ('memory usage statistics'), making the tool's purpose immediately understandable. It doesn't distinguish from siblings like 'get_status' or 'get_insights', but the specific focus on memory statistics provides adequate clarity.

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 is provided on when to use this tool versus alternatives like 'get_status' or 'get_insights'. The description only states what it does, not when it should be selected over sibling tools that might also provide system 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/MikeyBeez/mcp-contemplation'

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