Skip to main content
Glama

inspect

View all memories with decay status, relevance scores, ages, health stats, and category breakdown to debug memory performance.

Instructions

Debug view: all memories with decay status, relevance scores, ages, and health stats. Also shows category breakdown.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handleInspect() function that executes the inspect tool logic. Loads all memories, computes relevance for each, categorizes their status (ACTIVE/FADING/DEAD), and returns debug view with health stats, category breakdown, and all memories sorted by relevance.
    function handleInspect() {
      const memories = loadMemories();
      const now = Date.now();
    
      let active = 0, fading = 0, dead = 0;
      const categories = {};
    
      const inspected = memories.map(m => {
        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 {
          id: m.id,
          content: m.content.slice(0, 100) + (m.content.length > 100 ? '...' : ''),
          category: m.category,
          mentions: m.mention_count,
          age_days: rel.age_days,
          relevance: rel.relevance,
          decay: rel.decay,
          status: rel.status,
        };
      }).sort((a, b) => b.relevance - a.relevance);
    
      return {
        total: inspected.length,
        active,
        fading,
        dead,
        categories,
        health: dead > active ? 'NEEDS_PRUNING' : active > 0 ? 'HEALTHY' : 'EMPTY',
        memories: inspected,
        store_path: STORE_FILE,
      };
    }
  • The input schema for the inspect tool. It has no required properties (empty object), meaning inspect takes no arguments.
      name: 'inspect',
      description: 'Debug view: all memories with decay status, relevance scores, ages, and health stats. Also shows category breakdown.',
      inputSchema: { type: 'object', properties: {} }
    },
  • index.js:513-513 (registration)
    The tool dispatch case where 'inspect' maps to handleInspect() in the tools/call handler.
    case 'inspect': result = handleInspect(); break;
  • index.js:417-461 (registration)
    Tool definitions including the inspect tool's name and description registered in getToolDefinitions().
    getToolDefinitions() {
      return [
        {
          name: 'remember',
          description: 'IMPORTANT: Call this whenever the user reveals a preference, fact about themselves, correction, or recurring interest. Auto-categorizes if no category given. Auto-deduplicates similar content. Categories: one-time (7d), question (14d), interest (60d), preference (180d), correction (365d), fact (365d), context (30d).',
          inputSchema: {
            type: 'object',
            properties: {
              content: { type: 'string', description: 'What to remember. Keep concise — under 20 words.' },
              category: { type: 'string', enum: Object.keys(CATEGORY_CONFIG), description: 'Optional. Auto-detected if omitted.' },
              tags: { type: 'string', description: 'Optional comma-separated tags.' }
            },
            required: ['content']
          }
        },
        {
          name: 'recall',
          description: 'Search memories by topic. Auto-reinforces strong matches. Auto-prunes dead memories. Leave query empty to get all active memories ranked by relevance.',
          inputSchema: {
            type: 'object',
            properties: {
              query: { type: 'string', description: 'Search query. Leave empty for all.' },
              limit: { type: 'number', description: 'Max results. Default: 10.' },
              min_relevance: { type: 'number', description: 'Min relevance 0-1. Default: 0.05.' }
            }
          }
        },
        {
          name: 'forget',
          description: 'Delete a memory by ID or content match (fuzzy). Use when the user says to forget something.',
          inputSchema: {
            type: 'object',
            properties: {
              id: { type: 'string', description: 'Memory ID (from inspect)' },
              content: { type: 'string', description: 'Fuzzy content match' }
            }
          }
        },
        {
          name: 'inspect',
          description: 'Debug view: all memories with decay status, relevance scores, ages, and health stats. Also shows category breakdown.',
          inputSchema: { type: 'object', properties: {} }
        },
      ];
    }
  • The computeRelevance helper function used by handleInspect to calculate decay status, relevance score, and health for each memory.
    function computeRelevance(memory, now = Date.now()) {
      const age_ms = now - memory.last_reinforced;
      const age_days = age_ms / (1000 * 60 * 60 * 24);
      const decay = Math.pow(0.5, age_days / memory.decay_halflife_days);
      const freq_boost = 1 + Math.log2(memory.mention_count);
      const relevance = memory.base_weight * decay * freq_boost;
    
      return {
        relevance: Math.round(relevance * 1000) / 1000,
        decay: Math.round(decay * 1000) / 1000,
        freq_boost: Math.round(freq_boost * 100) / 100,
        age_days: Math.round(age_days * 10) / 10,
        status: relevance > 0.5 ? 'ACTIVE' : relevance > 0.1 ? 'FADING' : 'DEAD',
      };
    }
Behavior4/5

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

Describes what it shows (all memories, various stats) and implies read-only behavior. No annotations, but no contradictions. Could mention no side effects explicitly.

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?

Two sentences, front-loaded with purpose, no fluff. Efficient and clear.

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

Completeness4/5

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

Adequate for a simple debug tool with no parameters. Could mention limitations or what is not shown, but complete enough.

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 in input schema, so baseline of 4 applies. Description adds no parameter info, which is fine.

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

Purpose5/5

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

Clearly states it is a debug view showing all memories with specific fields (decay status, relevance scores, ages, health stats, category breakdown), differentiating it from sibling tools like forget, recall, remember.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Implied usage for debugging, but no explicit when-to-use or when-not-to-use guidance. Sibling tools provide context but description lacks direct alternatives.

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