Skip to main content
Glama

Delete Memory

delete_memory
Destructive

Delete a single memory by ID or bulk-remove all memories sharing any given tags. Use to purge incorrect, duplicate, or test data, verifying tags first since bulk deletion has no dry-run.

Instructions

Delete a memory by ID (memory_id) or bulk-delete by tag (tags). Use sparingly — consider update_memory instead.

Mode 1 — Single (default): pass memory_id to delete one memory and its embedding. Idempotent: re-running on the same ID is a no-op.

Mode 2 — Bulk-by-tag: pass tags: [...] to delete ALL memories tagged with ANY of these tags. Tag matching is exact (case-insensitive), any-of mode. There is NO dry-run. This can delete thousands of memories in one call. NOT idempotent in practice — re-running may catch new memories that were tagged the same way after the first call. Verify with recall_memory({ tags, exhaustive: true }) first if uncertain.

When to use:

  • Memory contains incorrect information that can't be corrected (Mode 1)

  • Memory is a duplicate (Mode 1)

  • Cleanup of benchmark/test data scoped by tag (Mode 2)

  • Removing all memories under a deprecated tag namespace (Mode 2)

Examples:

  • delete_memory({ memory_id: "8f3a2c1e-5b7d-4e9a-a1c3-2d4f6b8e0a91" }) // Mode 1

  • delete_memory({ tags: ["benchmark-test"] }) // Mode 2, bulk by tag

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "delete_memory"
  }
}

Input Schema

NameRequiredDescriptionDefault
tagsNoBulk mode (XOR with `memory_id`): deletes ALL memories with ANY of these tags. Exact, case-insensitive. No dry-run.
memory_idNoSingle mode (XOR with `tags`).

Output Schema

NameRequiredDescriptionDefault
tagsNoBulk mode.
messageYes
memory_idNoSingle mode.
deleted_countNoBulk mode.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed6 schema fields changedv0.14.4
    • changedInput schema / properties / memory_id / description
      Previous value: -"Single-delete mode (XOR with `tags`). ID of the memory to delete (from store_memory or recall results)."New value: +"Single mode (XOR with `tags`)."
    • changedInput schema / properties / tags / description
      Previous value: -"Bulk-delete mode (XOR with `memory_id`). Bulk-deletes ALL memories tagged with ANY of these tags. Exact match, case-insensitive. No dry-run."New value: +"Bulk mode (XOR with `memory_id`): deletes ALL memories with ANY of these tags. Exact, case-insensitive. No dry-run."
    • changedOutput schema / properties / deleted_count / description
      Previous value: -"Bulk-delete result: number of memories deleted."New value: +"Bulk mode."
    • changedOutput schema / properties / memory_id / description
      Previous value: -"Single-delete result: ID of the deleted memory."New value: +"Single mode."
    • removedOutput schema / properties / message / description
      Removed value: -"Confirmation message"
    • changedOutput schema / properties / tags / description
      Previous value: -"Bulk-delete result: tags that were used for the bulk delete."New value: +"Bulk mode."
  2. First observedv0.14.0

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already declare destructive=true and idempotentHint=false, but the description goes substantially further: it discloses that Mode 1 removes the memory and its embedding, that Mode 1 is idempotent, that Mode 2 is NOT idempotent in practice, and that there is no dry-run with potential thousands of deletions per call. These are exactly the risk details an agent needs beyond the boolean hints.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the core behavior, then cleanly sectioned by mode with bold headers and examples. It is on the long side, and the 'When to use' bullets partly restate mode semantics, but every block carries operational value.

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?

For a destructive, optionally-bulk operation the description covers scope, reversibility, idempotency per mode, verification path, and failure risks; an output schema exists so return values need no explanation. Nothing an agent needs in order to call this safely is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3; the description earns above that by explaining the XOR relationship as two named modes and clarifying that tag matching is exact, case-insensitive, and any-of. The worked examples reinforce the parameter shapes without contradicting 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?

Opens with a specific verb and resource plus the two distinct operating modes (by `memory_id` and by `tags`), which separates it cleanly from siblings like `update_memory` and `recall_memory`. An agent knows immediately what the tool does and at what granularity.

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?

Explicitly states 'Use sparingly — consider `update_memory` instead' and provides a concrete when-to-use list for both modes, plus a verification step with `recall_memory({ tags, exhaustive: true })` before irreversible bulk deletion. Both alternatives and exclusions are named.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.