Skip to main content
Glama

memory_merge

Destructive

Consolidate duplicate memory findings into one canonical entry: pick a survivor, fold source memories into it, and archive losers with supersession pointers.

Instructions

Consolidate 2+ memories into one canonical row. Acts on a memory_audit duplicate finding: pick the survivor (target_ref) and fold the rest (source_refs) into it. Sources are archived with a tombstone and a supersession pointer to the target (same mechanism as memory_archive/supersede, N:1 instead of 1:1); the target's times_seen sums in each source's count. Unlike forget/archive on a duplicate pair, this consolidates both sides into one row instead of just discarding one.

Input Schema

NameRequiredDescriptionDefault
noteNoOptional note about this merge, stored in supersession tombstones on the losers
target_refYesRef of the canonical memory that survives the merge (must already exist, active)
source_refsYesRefs of the losing memories to fold into the target (all must be active)
hard_delete_losersNoHard-delete losers after archiving/superseding them (default false).
append_loser_bodiesNoAppend loser bodies to the target content under section markers (default false). Off by default — review loser bodies (returned in the result) before deciding.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.5.1

TDQS

A4.7/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 substantial detail beyond them: losers are archived with a tombstone plus a supersession pointer, the target's times_seen absorbs each source's count, and hard_delete_losers defaults to false. It also warns that append_loser_bodies is off by default so the agent can review returned loser bodies first — exactly the pre-destruction context an agent needs.

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?

Four sentences, all load-bearing, with the core action front-loaded before the mechanism, the alternative comparison, and the parameter caveats. No filler.

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?

No output schema exists, and the description covers the gap by noting loser bodies are returned in the result for review. Combined with the mechanism explanation and destructive-operation semantics, an agent has everything needed to invoke it safely.

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 description coverage is 100%, so the schema already documents every parameter including defaults, so the baseline is 3. The description reinforces the survivor/loser roles of target_ref and source_refs and the times_seen merging behavior, but adds no syntax or format detail the schema lacks.

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 and resource ('Consolidate 2+ memories into one canonical row') and explicitly distinguishes itself from siblings memory_archive/supersede (N:1 instead of 1:1) and forget/archive on a duplicate pair. An agent can route to it without opening any schema.

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?

Names the trigger context ('Acts on a memory_audit duplicate finding') and the alternatives it supersedes ('Unlike forget/archive on a duplicate pair, this consolidates both sides into one row instead of just discarding one'). When-to-use and when-not-to-use are both explicit.

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