Skip to main content
Glama

delete_long_term_memory

Remove specific long-term memories by name to manage stored information and maintain relevant data in memory systems.

Instructions

Delete a long-term memory by name.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes

Implementation Reference

  • The main handler function for the 'delete_long_term_memory' tool. Receives arguments, calls LongTermMemoryManager.deleteMemory, persists via storageManager.saveLongTermMemories, and returns formatted success/error response.
    handler: async (args) => { try { const success = memoryManager.deleteMemory(args.name); if (success) { await storageManager.saveLongTermMemories(memoryManager.getMemories()); return { success: true, message: `Memory "${args.name}" deleted successfully`, remainingMemories: memoryManager.getMemories().length }; } else { return { success: false, message: `Memory "${args.name}" not found` }; } } catch (error) { return { success: false, error: error.message }; } }
  • Zod input schema defining parameters: 'name' (required string) and 'conversation_id' (optional string).
    inputSchema: z.object({ name: z.string().describe('Name of the memory to delete'), conversation_id: z.string().optional().describe('Conversation ID that owns this memory') }),
  • Core deletion logic in LongTermMemoryManager class: filters memories array by name and returns boolean success.
    deleteMemory(name) { const initialLength = this.memories.length; this.memories = this.memories.filter(mem => mem.name !== name); return this.memories.length < initialLength; }
  • src/index.js:293-295 (registration)
    Dynamic registration and invocation: recreates long-term tools for specific conversation_id and calls the matching tool handler during MCP call_tool requests.
    const tools = createLongTermTools(manager, storage); const tool = tools.find(t => t.name === toolName); result = await withTimeout(tool.handler(validatedArgs), timeout, `Tool ${toolName} timeout`);

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/win10ogod/memory-mcp-server'

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