Skip to main content
Glama

deduplicate_memories

Destructive

Find and remove duplicate memories by comparing content similarity. Preview duplicates with dry run first, then delete them and refresh the cache when ready.

Instructions

Detect and optionally remove duplicate memories using content similarity. Run with dry_run=true first to preview. Compares all memories pairwise using Jaccard similarity. Groups duplicates with a primary (oldest) and candidates for removal. Returns: summary with duplicate groups. Side effects (when dry_run=false): deletes duplicate memories, invalidates cache.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dry_runNotrue: preview duplicates without deletion (safe). false: actually delete duplicates (destructive). Default: true.
user_idNoUser namespace to deduplicate. Default: "oliver".
similarity_thresholdNoMinimum similarity (0-1) to consider as duplicate. 0.85 = 85% similar. Higher = stricter. Range: 0.5-1.0. Default: 0.85.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed6 schema fields changedv1.3.2
    • removedInput schema / properties / dry_run / default
      Removed value: -true
    • changedInput schema / properties / dry_run / description
      Previous value: -"Preview duplicates without deleting"New value: +"true: preview duplicates without deletion (safe). false: actually delete duplicates (destructive). Default: true."
    • removedInput schema / properties / similarity_threshold / default
      Removed value: -0.85
    • changedInput schema / properties / similarity_threshold / description
      Previous value: -"Similarity threshold for duplicate detection (0-1)"New value: +"Minimum similarity (0-1) to consider as duplicate. 0.85 = 85% similar. Higher = stricter. Range: 0.5-1.0. Default: 0.85."
    • removedInput schema / properties / user_id / default
      Removed value: -"oliver"
    • addedInput schema / properties / user_id / description
      Added value: +"User namespace to deduplicate. Default: \"oliver\"."
  2. First observedv1.3.1

TDQS

A4.5/5.0
Behavior5/5

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

Annotations already flag destructiveHint=true, and the description adds valuable behavior: it deletes duplicates, invalidates cache, uses Jaccard similarity, groups with primary oldest, and supports a safe dry-run mode. No contradiction with annotations.

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?

Every sentence earns its place: purpose, safety instruction, method, grouping behavior, return value, and side effects. Front-loaded with the core action and preview guidance; no filler or redundancy.

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?

Despite no output schema, the description states what is returned ('summary with duplicate groups'). The pairwise algorithm, grouping strategy, dry-run behavior, and side effects are all covered. Sufficient for an agent to invoke it correctly, especially with the destructive flag properly contextualized.

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%, so each parameter already has a rich description. The tool description adds no parameter-level detail beyond the schema, which is acceptable; the baseline of 3 applies.

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?

States a specific verb ('Detect and optionally remove') and resource ('duplicate memories'), with a precise method (content similarity, Jaccard, pairwise). Clearly differentiates itself from siblings like delete_memory by focusing on deduplication rather than single-record operations.

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?

Explicitly instructs to run with dry_run=true first for safe preview, and warns that dry_run=false is destructive. While it doesn't name sibling alternatives or provide when-not-to-use guidance, the operational workflow is clear and actionable.

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