Skip to main content
Glama

recall_memory

Retrieve stored information from memory using specific keys and categories to access previously saved data.

Instructions

recall|remember|what was|remind|retrieve - Retrieve from memory

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
keyYesMemory key to retrieve
categoryNoMemory category to search in

Implementation Reference

  • The main handler function that executes the recall_memory tool logic. It retrieves a memory entry by key using the MemoryManager singleton and returns the memory content or an error message.
    export async function recallMemory(args: { key: string; category?: string }): Promise<ToolResult> {
      const { key: recallKey } = args;
    
      try {
        const memoryManager = MemoryManager.getInstance();
        const memory = memoryManager.recall(recallKey);
    
        if (memory) {
          return {
            content: [{ type: 'text', text: `${memory.key}: ${memory.value}\n[${memory.category}]` }]
          };
        } else {
          return {
            content: [{ type: 'text', text: `✗ Not found: "${recallKey}"` }]
          };
        }
      } catch (error) {
        return {
          content: [{ type: 'text', text: `✗ Error: ${error instanceof Error ? error.message : 'Unknown error'}` }]
        };
      }
    }
  • The ToolDefinition object defining the schema, name, description, and input parameters for the recall_memory tool.
    export const recallMemoryDefinition: ToolDefinition = {
      name: 'recall_memory',
      description: 'recall|remember|what was|remind|retrieve - Retrieve from memory',
      inputSchema: {
        type: 'object',
        properties: {
          key: { type: 'string', description: 'Memory key to retrieve' },
          category: { type: 'string', description: 'Memory category to search in' }
        },
        required: ['key']
      },
      annotations: {
        title: 'Recall Memory',
        audience: ['user', 'assistant']
      }
    };
  • src/index.ts:638-639 (registration)
    Registration in the tool execution switch statement in index.ts, dispatching calls to the recallMemory handler.
    case 'recall_memory':
      return await recallMemory(args as any) as CallToolResult;
  • src/index.ts:126-126 (registration)
    Inclusion of recallMemoryDefinition in the tools array for tool listing and discovery.
    recallMemoryDefinition,
  • src/index.ts:63-63 (registration)
    Import of the recallMemory handler and definition from its module.
    import { recallMemory, recallMemoryDefinition } from './tools/memory/recallMemory.js';

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