Skip to main content
Glama

forget

Permanently delete specific AI memories by UUID to remove outdated facts before storing corrections. Prevents contradictory data in recall results. Requires exact memory ID from previous queries. Irreversible single-record operation.

Instructions

Permanently delete a memory by ID. This is a destructive, irreversible operation that soft-deletes the memory record (it will no longer appear in recall or context results). Use forget before storing a corrected version of a fact, to prevent contradictory memories from coexisting. Do not use for bulk cleanup (delete one at a time). Do not use if you are unsure whether the memory is outdated, as deletion cannot be undone. Requires the exact memory ID (UUID), which is returned by recall and context. Costs 1 operation. Returns confirmation on success, or an error if the ID does not exist.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
memory_idYesUUID of the memory to delete. Get this from recall or context results (the 'id' field). Must be an exact match.

Implementation Reference

  • MCP server handler for 'forget' tool. Makes DELETE API call to /memories/{memory_id} endpoint. Returns confirmation text on success.
    // Tool 3: forget
    server.tool(
      "forget",
      `Permanently delete a memory by ID. This is a destructive, irreversible operation that soft-deletes the memory record (it will no longer appear in recall or context results). Use forget before storing a corrected version of a fact, to prevent contradictory memories from coexisting. Do not use for bulk cleanup (delete one at a time). Do not use if you are unsure whether the memory is outdated, as deletion cannot be undone. Requires the exact memory ID (UUID), which is returned by recall and context. Costs 1 operation. Returns confirmation on success, or an error if the ID does not exist.`,
      {
        memory_id: z.string().describe("UUID of the memory to delete. Get this from recall or context results (the 'id' field). Must be an exact match."),
      },
      async ({ memory_id }) => {
        await apiCall(`/memories/${memory_id}`, "DELETE");
        return {
          content: [
            {
              type: "text" as const,
              text: `Memory ${memory_id} has been deleted.`,
            },
          ],
        };
      },
    );
  • Local server handler for 'forget' tool. Calls softDelete() helper to perform soft delete in SQLite database. Returns JSON with deleted status and memory_id, or error message.
    // --- forget ---
    server.tool(
      "forget",
      "Delete a memory that is outdated, incorrect, or superseded. Call this when you store an updated version of a fact — delete the old one to prevent contradictions.",
      {
        memory_id: z.string().describe("ID of the memory to delete"),
      },
      async ({ memory_id }) => {
        try {
          const deleted = softDelete(memory_id);
          return {
            content: [
              {
                type: "text" as const,
                text: JSON.stringify({ deleted, memory_id }),
              },
            ],
          };
        } catch (err: any) {
          return {
            content: [{ type: "text" as const, text: `Error forgetting: ${err.message}` }],
            isError: true,
          };
        }
      }
    );
  • softDelete helper function that performs the actual database operation. Updates memories table setting deleted_at timestamp for soft-delete behavior.
    export function softDelete(memoryId: string): boolean {
      const db = getDb();
      const result = db.prepare(`
        UPDATE memories SET deleted_at = datetime('now')
        WHERE id = ? AND deleted_at IS NULL
      `).run(memoryId);
      return result.changes > 0;
    }
  • API schema definition for 'forget' tool. Defines tool name, description, endpoints, and input parameters (agent_id, memory_id).
      name: "forget",
      description: "Delete a memory by ID. Keep knowledge accurate by removing outdated information.",
      endpoint: "POST /memories/forget",
      x402_endpoint: "POST /x402/forget",
      input: {
        agent_id: { type: "string", required: true },
        memory_id: { type: "string", required: true },
      },
    },
Behavior5/5

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

With no annotations provided, the description carries the full burden and excels: it discloses the destructive/irreversible nature, clarifies it's a soft-delete (behavioral nuance), states the operation cost ('Costs 1 operation'), and describes error conditions ('error if the ID does not exist').

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?

Eight sentences cover: core action, safety profile, usage scenario, two exclusion cases, parameter requirements, cost, and return behavior. Every sentence earns its place in a front-loaded structure that prioritizes the destructive nature of the operation.

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

Completeness5/5

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

Comprehensive coverage for a destructive operation with no output schema: it explains return values ('Returns confirmation on success'), error states, and sibling relationships. No gaps remain given the tool's complexity and lack of structured annotations.

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?

The input schema has 100% description coverage ('UUID of the memory to delete...'), establishing a baseline of 3. The description reinforces this ('Requires the exact memory ID...returned by recall and context') but adds minimal semantic value beyond what the schema already provides.

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 opens with a specific verb+resource combination ('Permanently delete a memory by ID') that clearly distinguishes this tool from its siblings (remember, recall, context, share). It explicitly scopes the operation to individual ID-based deletion.

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

Usage Guidelines5/5

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

Provides explicit positive guidance ('Use forget before storing a corrected version of a fact') and negative constraints ('Do not use for bulk cleanup', 'Do not use if you are unsure whether the memory is outdated'). It contextualizes the tool within the memory correction workflow against alternatives.

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/AlekseiMarchenko/central-intelligence'

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