Skip to main content
Glama

cluster_memories

Cluster similar memories using semantic similarity to consolidate redundant entries and identify duplicate pairs. Helps organize memory storage efficiently.

Instructions

Cluster similar memories for potential consolidation or find duplicates.

Groups similar memories based on semantic similarity (if embeddings are enabled) or other strategies. Useful for identifying redundant memories.

Args: strategy: Clustering strategy (default: "similarity"). threshold: Similarity threshold for linking (0.0-1.0, uses config default if not specified). max_cluster_size: Maximum memories per cluster (1-100, uses config default if not specified). find_duplicates: Find likely duplicate pairs instead of clustering. duplicate_threshold: Similarity threshold for duplicates (0.0-1.0, uses config default).

Returns: List of clusters or duplicate pairs with scores and suggested actions.

Raises: ValueError: If any input fails validation.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
strategyNosimilarity
thresholdNo
find_duplicatesNo
max_cluster_sizeNo
duplicate_thresholdNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior5/5

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

With no annotations, the description carries the full burden. It discloses that clustering uses 'semantic similarity (if embeddings are enabled) or other strategies,' explains parameter constraints and config defaults, describes the return value ('List of clusters or duplicate pairs with scores and suggested actions'), and notes the exception ('ValueError: If any input fails validation'). This gives a comprehensive behavioral picture.

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?

The description is well-structured and front-loaded: a one-sentence summary, a short explanatory paragraph, then a clear Args/Returns/Raises breakdown. Each section is informative without redundancy, and the formatting uses standard docstring conventions.

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?

Given five parameters, no annotations, and an output schema (but not shown here), the description provides essential context: purpose, parameter semantics, return type, and error behavior. It is sufficiently detailed for an agent to invoke the tool correctly and understand the outcome.

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

Parameters5/5

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

Schema description coverage is 0%, but the Args section fully compensates by explaining every parameter: strategy, threshold (0.0-1.0, config default), max_cluster_size (1-100), find_duplicates (boolean), and duplicate_threshold (0.0-1.0). This adds meaningful constraints and defaults beyond 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?

The description clearly states the tool's function: 'Cluster similar memories for potential consolidation or find duplicates.' It specifies the verb (cluster/find), resource (memories), and differentiates from siblings like consolidate_memories by noting it is for 'potential consolidation' and 'identifying redundant memories.'

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?

The description provides context for when to use the tool: 'Useful for identifying redundant memories' and 'for potential consolidation.' It implies this is a preparatory step before consolidate_memories, but does not explicitly name alternatives or state when not to use it. This is clear context without explicit exclusionary guidance.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/fastmcp-me/mnemex'

If you have feedback or need assistance with the MCP directory API, please join our Discord server