Skip to main content
Glama

delete_memory

Remove specific stored data from memory by specifying its key to manage information retention in AI systems.

Instructions

forget|delete|remove|erase - Delete specific memory

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
keyYesMemory key to delete

Implementation Reference

  • Main handler function for delete_memory tool. Uses MemoryManager to delete the specified memory key and returns a ToolResult with appropriate success or failure message.
    export async function deleteMemory(args: { key: string }): Promise<ToolResult> {
      const { key: deleteKey } = args;
    
      try {
        const mm = MemoryManager.getInstance();
        const deleted = mm.delete(deleteKey);
    
        if (deleted) {
          return {
            content: [{ type: 'text', text: `✓ Deleted memory: "${deleteKey}"` }]
          };
        } else {
          return {
            content: [{ type: 'text', text: `✗ Memory not found: "${deleteKey}"` }]
          };
        }
      } catch (error) {
        return {
          content: [{ type: 'text', text: `✗ Error: ${error instanceof Error ? error.message : 'Unknown error'}` }]
        };
      }
    }
  • ToolDefinition object defining the schema for the delete_memory tool, including input schema requiring a 'key' string parameter.
    export const deleteMemoryDefinition: ToolDefinition = {
      name: 'delete_memory',
      description: 'forget|delete|remove|erase - Delete specific memory',
      inputSchema: {
        type: 'object',
        properties: {
          key: { type: 'string', description: 'Memory key to delete' }
        },
        required: ['key']
      },
      annotations: {
        title: 'Delete Memory',
        audience: ['user', 'assistant']
      }
    };
  • src/index.ts:124-135 (registration)
    Registration of deleteMemoryDefinition in the main tools array, which is served via the ListTools MCP handler with pagination support.
    // Memory Management Tools
    saveMemoryDefinition,
    recallMemoryDefinition,
    listMemoriesDefinition,
    deleteMemoryDefinition,
    searchMemoriesDefinition,
    updateMemoryDefinition,
    autoSaveContextDefinition,
    restoreSessionContextDefinition,
    prioritizeMemoryDefinition,
    startSessionDefinition,
  • src/index.ts:642-643 (registration)
    Dispatch registration in the central tool switch statement within executeToolCall, mapping 'delete_memory' calls to the deleteMemory handler.
    case 'delete_memory':
      return await deleteMemory(args as any) as CallToolResult;
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the action is deletion, implying a destructive mutation, but doesn't specify whether this is permanent, reversible, requires specific permissions, or has side effects (e.g., affecting related memories). For a destructive tool with zero annotation coverage, this is a significant gap in transparency.

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 extremely concise and front-loaded, using a single phrase with synonymous verbs for clarity. Every word earns its place by emphasizing the deletion action and target resource without redundancy or unnecessary elaboration. It efficiently communicates the core purpose in minimal text.

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 incomplete. It lacks details on behavioral traits (e.g., permanence, error handling), usage context relative to siblings, and expected outcomes. For a mutation tool in a memory management system, this leaves critical gaps for an agent to operate safely and effectively.

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%, with the single parameter 'key' documented as 'Memory key to delete'. The description adds no additional meaning beyond this, such as explaining what constitutes a valid key format or where to obtain it. With high schema coverage, the baseline score of 3 is appropriate, as the schema adequately defines the parameter without extra description.

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 ('specific memory') with multiple synonymous verbs for emphasis. It distinguishes from sibling tools like 'list_memories', 'recall_memory', 'save_memory', and 'update_memory' by specifying deletion rather than listing, retrieving, creating, or modifying. However, it doesn't explicitly differentiate from 'prioritize_memory' or 'search_memories' in terms of when deletion is appropriate versus those operations.

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. It doesn't mention prerequisites (e.g., needing to know the memory key from 'list_memories' or 'recall_memory'), exclusions (e.g., not for bulk deletion), or comparisons to siblings like 'update_memory' for modification instead of deletion. The agent must infer usage from the tool name and context alone.

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