Skip to main content
Glama

cluster

Detect communities of related documents via Louvain modularity on typed-edge graphs. Use a query or seed document IDs to obtain clusters with members and summary statistics.

Instructions

Community detection over the typed-edge graph via Louvain modularity (Blondel et al. 2008) using graphology + graphology-communities-louvain. Deterministic: same input produces byte-identical cluster_id assignment via DocId-sorted node insertion + seeded RNG (vault-memory-cluster-v1). cluster_id = smallest member DocId per community. Hard-capped at 5000 nodes; pass force: true to override. Either query (composes search_hybrid + expand 1-hop) OR seed_doc_ids (uses provided seeds + induced 1-hop neighborhood); not both — passing both returns {ok:false, reason:'both_seeds_and_query'}. On the query path with multiple vaults configured, the vault field is required so search scope is deterministic; single-vault setups may omit it (returns {ok:false, reason:'vault_required'} otherwise). Returns per-cluster {cluster_id, size, members[], summary: {top_types, top_titles, edge_density}}. No LLM enrichment — summary fields are pure-deterministic computations (LLM enrichment is Phase 5 brief layer's job). _memory opacity inherited from expand() (Plan 04-03).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryNo
seed_doc_idsNo
vaultNo
methodYes
query_top_kNo
forceNo
Behavior5/5

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

With no annotations, the description fully discloses deterministic output, node cap, force override, mutual exclusion of parameters, vault requirement, and that no LLM enrichment is performed. This is comprehensive.

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 thorough but each sentence adds value. Slightly longer than necessary, but well-organized and front-loaded with key behavior. Could be structured into clearer sections for parameters.

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 no output schema, the description fully explains return value structure (cluster_id, size, members, summary fields) and the deterministic nature. It also addresses memory opacity inheritance from expand. The tool's role is complete.

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 has 0% description coverage, but the description explains each parameter in detail: query path, seed_doc_ids path, vault, method (const), query_top_k (default/max), force (default). It adds operational semantics 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 it performs community detection via Louvain modularity, with deterministic behavior and specific cluster_id assignment. It distinguishes itself from siblings (like expand, search) by focusing on clustering.

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 explicitly explains when to use query vs seed_doc_ids, the mutually exclusive constraint, vault requirement in multi-vault setups, and force override for node cap. It does not explicitly name alternatives but provides clear usage context.

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/owrede/vault-memory'

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