Skip to main content
Glama

Consolidate memories

consolidate

Clusters similar stored memories by embedding similarity and optionally creates linked derived memories, supporting periodic memory cleanup and reducing redundant entries.

Instructions

Cluster similar memories via embedding similarity and optionally create derived/consolidated memories linked via 'derived_from'. Use during periodic consolidation.

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": "consolidate"
  }
}

Input Schema

NameRequiredDescriptionDefault
deriveNoCreate a derived memory for each cluster
userIdNoScope to a user (USER scope)
projectIdNoScope to a project
sessionIdNoScope to a session (SESSION scope)
thresholdNoCosine similarity threshold for clustering (default 0.7)
minClusterSizeNoMinimum members to report a cluster (default 2)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv2.4.2
    • removedInput schema / additionalProperties
      Removed value: -false
  2. Changed2 schema fields changedv2.3.0
    • addedInput schema / properties / sessionId
      Added value: +{
      +  "description": "Scope to a session (SESSION scope)",
      +  "type": [
      +    "string",
      +    "null"
      +  ]
      +}
    • addedInput schema / properties / userId
      Added value: +{
      +  "description": "Scope to a user (USER scope)",
      +  "type": [
      +    "string",
      +    "null"
      +  ]
      +}
  3. First observedv2.2.1

TDQS

A3.5/5.0
Behavior3/5

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

No annotations are supplied, so the description carries the full behavioral burden. It does disclose the mechanism and the conditional write ('optionally create derived memories'), which is genuinely useful, but it says nothing about whether original memories are modified or deleted, whether the operation is idempotent, or what a consolidated memory's contents look like.

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?

Two tight sentences with the core mechanism front-loaded and the optional behavior second. The closing usage sentence is somewhat vague but still occupies little space; nothing is wasted.

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?

Six optional parameters with a fully documented schema and no annotations make this a moderately complex, mutation-capable tool. The description covers the mechanism and write condition adequately, though with no output schema the return shape (a cluster report? created memories?) remains unspecified.

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 all six parameters are already documented, including threshold default 0.7 and minClusterSize default 2. The description adds only that 'derive' produces memories linked via 'derived_from'; it does not clarify scoping precedence (userId vs projectId vs sessionId) or how threshold affects output volume.

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?

States a specific verb and resource ('Cluster similar memories') plus the mechanism ('embedding similarity') and the optional side effect ('create derived/consolidated memories linked via derived_from'). This is clear, but it never distinguishes itself from near-neighbors like merge_memory or link_memory, leaving some ambiguity about which tool produces which shape of result.

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?

'Use during periodic consolidation' implies a trigger context but gives no explicit when-to-use vs when-not rules and names no alternatives among the 15 siblings. An agent still has to infer whether to reach for this instead of merge_memory or link_memory.

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