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 handler function listMemories that retrieves memories from MemoryManager, applies filters for category and limit, formats a list, and returns a formatted ToolResult or error.
    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 schema defining the list_memories tool, including name, description, inputSchema for optional category and limit parameters, 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:640-641 (registration)
    Registration in the tool dispatcher switch statement within executeToolCall function, mapping 'list_memories' calls to the listMemories handler.
    case 'list_memories': return await listMemories(args as any) as CallToolResult;
  • src/index.ts:127-127 (registration)
    Inclusion of listMemoriesDefinition in the central tools array used for ListTools requests.
    listMemoriesDefinition,

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