Skip to main content
Glama

list_memories

Retrieve and display saved memories from the Hi-AI assistant, with options to filter by category or limit results.

Instructions

list|saved items|show saved|what memories - List saved memories

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
categoryNoFilter by category
limitNoMaximum number of results

Implementation Reference

  • The core handler function that executes the list_memories tool. Retrieves memories using MemoryManager, filters by category and limit, formats them into a list, and returns as ToolResult.
    export async function listMemories(args: { category?: string; limit?: number }): Promise<ToolResult> {
      const { category: listCategory, limit = 10 } = args;
    
      try {
        const mm = MemoryManager.getInstance();
        const allMemories = mm.list(listCategory);
        const limitedMemories = allMemories.slice(0, limit);
    
        const memoryList = limitedMemories.map(m =>
          `• ${m.key} (${m.category}): ${m.value.substring(0, 50)}${m.value.length > 50 ? '...' : ''}`
        ).join('\n');
    
        return {
          content: [{
            type: 'text',
            text: `✓ Found ${allMemories.length} memories${listCategory ? ` in '${listCategory}'` : ''}:\n${memoryList || 'None'}`
          }]
        };
      } catch (error) {
        return {
          content: [{ type: 'text', text: `✗ Error: ${error instanceof Error ? error.message : 'Unknown error'}` }]
        };
      }
    }
  • The ToolDefinition object defining the list_memories tool, including its name, description, input schema, and annotations.
    export const listMemoriesDefinition: ToolDefinition = {
      name: 'list_memories',
      description: 'list|saved items|show saved|what memories - List saved memories',
      inputSchema: {
        type: 'object',
        properties: {
          category: { type: 'string', description: 'Filter by category' },
          limit: { type: 'number', description: 'Maximum number of results' }
        },
        required: []
      },
      annotations: {
        title: 'List Memories',
        audience: ['user', 'assistant']
      }
    };
  • src/index.ts:124-135 (registration)
    Registration of listMemoriesDefinition within the main tools array (lines 104-160), specifically in the Memory Management Tools section, enabling it for ListTools requests.
    // Memory Management Tools
    saveMemoryDefinition,
    recallMemoryDefinition,
    listMemoriesDefinition,
    deleteMemoryDefinition,
    searchMemoriesDefinition,
    updateMemoryDefinition,
    autoSaveContextDefinition,
    restoreSessionContextDefinition,
    prioritizeMemoryDefinition,
    startSessionDefinition,
  • Dispatcher in executeToolCall switch statement that routes 'list_memories' calls to the listMemories handler.
    case 'list_memories':
      return await listMemories(args as any) as CallToolResult;
  • Import of MemoryManager, the underlying helper used by listMemories to access stored memories.
    import { MemoryManager } from '../../lib/MemoryManager.js';
Behavior2/5

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

No annotations are provided beyond a title, so the description carries the full burden of behavioral disclosure. It only states the action ('List saved memories') without detailing what a 'memory' entails, how results are returned (e.g., format, pagination), or any constraints like rate limits or authentication needs. This leaves significant gaps in understanding the tool's behavior.

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?

The description is concise but poorly structured, using a pipe-separated list of synonyms followed by a dash and the main phrase. This format is somewhat cluttered and not front-loaded with clear information, though it avoids unnecessary verbosity. It could be more straightforwardly phrased for better readability.

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?

Given the lack of annotations and output schema, the description is incomplete. It does not explain what 'memories' are, how they are stored or retrieved, or what the return values look like. For a tool with no structured behavioral hints, this leaves too much ambiguity for effective use by an AI agent.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 100%, with clear descriptions for both parameters ('category' and 'limit'). The description adds no additional meaning about parameters beyond what the schema provides, such as examples of categories or default behaviors. Since the schema does the heavy lifting, the baseline score of 3 is appropriate.

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

Purpose2/5

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

The description 'list|saved items|show saved|what memories - List saved memories' is tautological, essentially restating the tool name 'list_memories' with synonyms. It does not specify what a 'memory' is in this context or distinguish this tool from sibling tools like 'search_memories' or 'recall_memory', leaving the purpose vague beyond the basic action implied by the name.

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

Usage Guidelines1/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. It does not mention sibling tools like 'search_memories' (which might allow more flexible querying) or 'recall_memory' (which might retrieve a specific memory), nor does it specify any context, prerequisites, or exclusions for usage.

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/ssdeanx/ssd-ai'

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