Skip to main content
Glama

cluster_memories

Group similar memories by semantic similarity to identify redundant entries and duplicates, enabling memory consolidation.

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

Behavior3/5

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

With no annotations, the description carries the full burden. It explains the grouping mechanism ('based on semantic similarity if embeddings are enabled'), the return type ('List of clusters or duplicate pairs with scores and suggested actions'), and error behavior ('Raises ValueError'). However, it does not disclose whether the operation is read-only or might trigger side effects, leaving some ambiguity for an agent.

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?

The description is well-structured with a brief summary followed by Args/Returns/Raises sections. It is front-loaded with the main purpose. While it is a bit verbose, each section serves a purpose and no filler text is present.

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?

Given the tool's complexity (5 optional params, no output schema description), the description covers the key aspects: purpose, parameters, return value, and exceptions. The existence of an output schema fills the need for return structure details. It lacks detailed usage scenarios or edge cases, but overall it is complete enough for an agent to effectively invoke it.

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 coverage is 0%, but the description compensates thoroughly. It explains each parameter with added context: strategy is 'Clustering strategy', threshold is 'Similarity threshold for linking (0.0-1.0, uses config default if not specified)', max_cluster_size is 'Maximum memories per cluster (1-100, uses config default)', find_duplicates changes behavior, and duplicate_threshold has its own range. This provides clear semantic meaning beyond the raw schema.

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 clearly states the tool's function: 'Cluster similar memories for potential consolidation or find duplicates' and 'Groups similar memories based on semantic similarity'. This is a specific verb+resource with useful context. However, it does not explicitly distinguish itself from the sibling tool 'consolidate_memories' or 'search_memory', so it falls short of a perfect score.

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?

The description notes it is 'Useful for identifying redundant memories', which implies a use case. However, it provides no explicit guidance on when to use this tool versus alternatives, nor does it mention any exclusions or prerequisites. This is adequate but not thorough.

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/cortexgraph'

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