Skip to main content
Glama

delete_long_term_memory

Remove specific long-term memory entries by name to manage stored information in memory management systems.

Instructions

Delete a long-term memory by name.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesName of the memory to delete
conversation_idNoConversation ID that owns this memory

Implementation Reference

  • The handler function for the 'delete_long_term_memory' MCP tool. It calls the LongTermMemoryManager's deleteMemory method, persists changes via storage, and returns appropriate success/error responses.
    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 for validating the tool's arguments: required 'name' and optional 'conversation_id'.
    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')
    }),
  • src/index.js:157-158 (registration)
    Registration of the long-term tools array (including delete_long_term_memory) into the MCP server's tool registry for default conversation.
    const longTermTools = createLongTermTools(defaultLongTermManager, defaultStorageManager);
    longTermTools.forEach(tool => registerTool(tool, 'long-term'));
  • Supporting deleteMemory method in LongTermMemoryManager class that removes the specified memory from the internal array and returns deletion success status.
    deleteMemory(name) {
      const initialLength = this.memories.length;
      this.memories = this.memories.filter(mem => mem.name !== name);
      return this.memories.length < initialLength;
    }
  • src/index.js:291-295 (registration)
    Dynamic recreation and execution of long-term tools during tool calls, ensuring conversation-specific managers are used.
    manager = await getLongTermManager(conversationId);
    storage = getStorageManager(conversationId);
    const tools = createLongTermTools(manager, storage);
    const tool = tools.find(t => t.name === toolName);
    result = await withTimeout(tool.handler(validatedArgs), timeout, `Tool ${toolName} timeout`);
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool deletes a memory, implying a destructive operation, but doesn't cover critical aspects like whether deletion is permanent, requires specific permissions, has side effects (e.g., on related data), or returns confirmation details. This leaves significant gaps for a mutation tool.

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?

The description is a single, direct sentence with zero wasted words, making it highly efficient and front-loaded. Every word contributes to the core purpose without unnecessary elaboration.

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 tool's complexity as a destructive operation with no annotations and no output schema, the description is insufficient. It doesn't explain the deletion behavior (e.g., permanence, effects), return values, or error handling, leaving the agent with incomplete information for safe and effective use.

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?

Schema description coverage is 100%, so the schema fully documents both parameters ('name' and 'conversation_id') with clear descriptions. The description adds no additional semantic context beyond implying the 'name' parameter is used for deletion, which is already covered by the schema. This meets the baseline for high schema coverage.

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

Purpose4/5

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

The description clearly states the action ('Delete') and resource ('a long-term memory by name'), making the purpose unambiguous. However, it doesn't explicitly differentiate from sibling tools like 'delete_short_term_memories' or 'cleanup_memories', which would require mentioning the specific memory type or deletion method.

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

Usage Guidelines2/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 like 'delete_short_term_memories' or 'cleanup_memories'. It lacks context about prerequisites, such as needing the memory name, or exclusions, like whether it works for all memory types.

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

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