Skip to main content
Glama

forget

Delete specific memories by ID or content match to manage stored information and prevent outdated data from persisting in AI systems.

Instructions

Explicitly delete a memory by ID or content match.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idNoMemory ID
contentNoContent to match (partial match)

Implementation Reference

  • The handler function for the 'forget' tool, which filters out memories by ID or content and saves the updated list.
    function handleForget(args) {
      const { id, content } = args;
      if (!id && !content) return { error: 'Provide "id" or "content" to forget' };
    
      let memories = loadMemories();
      const before = memories.length;
    
      if (id) {
        memories = memories.filter(m => m.id !== id);
      } else {
        const c = content.toLowerCase();
        memories = memories.filter(m => !m.content.toLowerCase().includes(c));
      }
    
      saveMemories(memories);
      const removed = before - memories.length;
      return { removed, remaining: memories.length };
    }
  • Definition and input schema for the 'forget' tool.
    name: 'forget',
    description: 'Explicitly delete a memory by ID or content match.',
    inputSchema: {
      type: 'object',
      properties: {
        id: { type: 'string', description: 'Memory ID' },
        content: { type: 'string', description: 'Content to match (partial match)' }
      }
  • index.js:463-463 (registration)
    The switch statement in the main tool dispatch logic that routes the 'forget' request to handleForget.
    case 'forget': result = handleForget(args); break;
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. While it states the delete operation, it omits critical behavioral traits: whether deletion is permanent/irreversible, what happens when content matches multiple memories, error behavior when IDs are not found, and whether the operation returns the deleted memory or a confirmation.

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?

Single, efficient sentence with zero waste. 'Explicitly' earns its place by distinguishing from 'prune'; 'by ID or content match' concisely maps to the two optional parameters. Front-loaded with the action verb.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the simple 2-parameter schema with complete coverage, the description is minimally adequate. However, for a destructive operation with no annotations and no output schema, it has clear gaps: it fails to warn about permanence, describe return values, or explain partial matching behavior (e.g., multiple matches).

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?

With 100% schema description coverage, the baseline is 3. The description adds minimal value by confirming the OR relationship between parameters ('by ID or content match'), but does not compensate for the lack of validation rules (e.g., that at least one parameter must be provided despite neither being required in the schema).

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

Purpose5/5

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

The description provides a specific verb ('delete'), clear resource ('memory'), and scope ('by ID or content match'). The adverb 'Explicitly' effectively distinguishes this from the sibling tool 'prune', signaling intentional, targeted deletion versus automatic or bulk cleanup.

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

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The word 'Explicitly' implies this tool is for intentional deletion versus automatic cleanup (like 'prune'), but the description lacks explicit when-to-use guidance, doesn't clarify the mutual exclusivity of ID vs content parameters, and fails to mention alternative tools like 'prune' for bulk operations.

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

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