Skip to main content
Glama

delete_memory

Remove outdated or incorrect memories by providing the memory ID. Keeps stored context accurate and relevant.

Instructions

Delete a memory by ID. Use when a memory is outdated, incorrect, or no longer relevant.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesThe memory ID to delete

Implementation Reference

  • The registerDeleteMemory function defines the 'delete_memory' MCP tool. It accepts an 'id' string, calls storage.delete(id), and returns a JSON response indicating success or memory-not-found.
    import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
    import { z } from "zod";
    import { RekindleStorage } from "../storage/sqlite.js";
    
    export function registerDeleteMemory(
      server: McpServer,
      storage: RekindleStorage
    ): void {
      server.tool(
        "delete_memory",
        "Delete a memory by ID. Use when a memory is outdated, incorrect, or no longer relevant.",
        {
          id: z.string().describe("The memory ID to delete"),
        },
        async ({ id }) => {
          const deleted = storage.delete(id);
          return {
            content: [
              {
                type: "text" as const,
                text: JSON.stringify({
                  success: deleted,
                  message: deleted
                    ? "Memory deleted"
                    : "Memory not found",
                }),
              },
            ],
          };
        }
      );
  • The input schema for 'delete_memory' tool: requires a single 'id' field of type string with a description 'The memory ID to delete'.
    {
      id: z.string().describe("The memory ID to delete"),
  • src/server.ts:7-21 (registration)
    Import of registerDeleteMemory from './tools/delete.js' and registration call at line 21 where the tool is registered on the MCP server.
    import { registerDeleteMemory } from "./tools/delete.js";
    import { registerUpdateMemory } from "./tools/update.js";
    import { registerBootReport } from "./tools/boot-report.js";
    import { registerEndSession } from "./tools/end-session.js";
    
    export function createServer(storage: RekindleStorage): McpServer {
      const server = new McpServer({
        name: "rekindle",
        version: "0.2.0",
      });
    
      registerStoreMemory(server, storage);
      registerSearchMemory(server, storage);
      registerListMemories(server, storage);
      registerDeleteMemory(server, storage);
  • The storage.delete(id) method used by the 'delete_memory' handler. It executes a SQL DELETE FROM memories WHERE id = ? and returns true if any row was affected.
    delete(id: string): boolean {
      const result = this.db
        .prepare(`DELETE FROM memories WHERE id = ?`)
        .run(id);
      return result.changes > 0;
    }
Behavior2/5

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

No annotations are provided, so the description must carry the burden. It only says 'Delete,' implying a destructive action but does not disclose permanence, reversibility, or any side effects. For a deletion tool, more transparency is needed.

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?

Two sentences with no wasted words. The purpose and usage are stated concisely and effectively.

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

Completeness4/5

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

Given the simple nature of a delete operation and the presence of sibling tools, the description is largely complete. However, it lacks information about output or confirmation, which is minor.

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 coverage is 100% with a description for the 'id' parameter. The description adds no extra meaning beyond the schema, meeting the baseline for high coverage.

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 clearly states 'Delete a memory by ID.' It uses a specific verb and resource, and is distinct from sibling tools like list_memories, search_memory, store_memory, and update_memory.

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

Usage Guidelines4/5

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

Provides explicit guidance: 'Use when a memory is outdated, incorrect, or no longer relevant.' This tells the agent when to invoke the tool, but does not mention alternatives or when not to use it.

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/Skitchy/rekindle'

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