Skip to main content
Glama

Merge memories

merge_memory

Merge a duplicate or near-duplicate memory into a canonical one, marking the source as superseded and recording provenance.

Instructions

Merge a duplicate/near-duplicate memory into a canonical one. The source becomes superseded and provenance is recorded in metadata.merged_from.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "sourceId": "<sourceId>",
      "targetId": "<targetId>"
    },
    "name": "merge_memory"
  }
}

Input Schema

NameRequiredDescriptionDefault
sourceIdYesMemory to merge away (becomes superseded)
targetIdYesCanonical memory to keep (becomes active)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changedv2.4.2
    • removedInput schema / additionalProperties
      Removed value: -false
    • addedInput schema / properties / sourceId / maximum
      Added value: +9007199254740991
    • addedInput schema / properties / sourceId / minimum
      Added value: +-9007199254740991
    • addedInput schema / properties / targetId / maximum
      Added value: +9007199254740991
    • addedInput schema / properties / targetId / minimum
      Added value: +-9007199254740991
  2. First observedv2.2.1

TDQS

A3.6/5.0
Behavior3/5

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

With no annotations provided, this sentence carries the behavioral burden and does disclose the key state change: the source is superseded rather than deleted, and provenance lands in metadata.merged_from. It stops short of stating reversibility, whether the merge can be undone, required preconditions (e.g., same type/workspace), or what the call returns.

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 short sentences, zero filler, with the core operation front-loaded and the side effect following. Every clause contributes information the agent needs.

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?

For a two-parameter mutation with full schema coverage and no output schema, the definition covers purpose, direction of the merge, and the resulting state of both records. The main residual gap is the absence of any safety or reversibility note, which matters more here because no annotations supply that context.

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% and both parameters already state which record becomes superseded and which becomes active. The description's phrase "duplicate/near-duplicate" adds a small amount of intent framing but no syntax or format detail beyond the schema, so the baseline 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a specific verb+resource ("Merge a duplicate/near-duplicate memory into a canonical one") and clarifies the source/target duality. It distinguishes the operation from update-style siblings implicitly, but never names the closest sibling (consolidate) so a direct comparison is left to the agent.

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

Usage Guidelines3/5

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

"Duplicate/near-duplicate" implies the triggering condition for use, which is useful. However, there is no explicit when-not guidance and no routing to alternatives such as consolidate, update_memory, or forget when a memory is stale rather than duplicated.

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