Skip to main content
Glama

code_clusters

Cluster code elements by directory proximity and vector similarity to reveal module boundaries and related code groups. Specify type (function, class, file) to get clusters with member counts and samples.

Instructions

Cluster code elements by directory proximity and vector similarity. Requires type (function | class | file). Returns clusters with member counts and samples — useful for understanding module boundaries and finding groups of related code. Depends on Qdrant embeddings.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
typeYesCode type to cluster
countNoNumber of clusters
profileNoResponse profilecompact
Behavior3/5

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

With no annotations, the description must carry the full burden. It discloses the dependence on Qdrant embeddings and mentions the clustering factors, but lacks details on side effects, performance, or handling of edge cases (e.g., empty results). It does not contradict any annotations.

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 extremely concise: two sentences that front-load the primary action and purpose. Every sentence adds value, with no fluff or repetition.

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?

Considering the tool has 3 parameters, no output schema, and no annotations, the description provides sufficient high-level context: what the tool does, what it returns, and its dependencies. It is complete enough for an AI agent to understand its functionality, though explicit output structure would improve completeness.

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% (all parameters described). The description only adds minor context for the 'type' parameter (enum values) and restates the schema's information for 'count' and 'profile'. No additional meaning is provided beyond what the schema already conveys.

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 action ('Cluster code elements') and the methodology ('by directory proximity and vector similarity'), specifying the required type parameter and the output (clusters with member counts and samples). It differentiates from siblings like 'find_similar_code' by focusing on clustering, not mere similarity search.

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 explains the use case ('useful for understanding module boundaries and finding groups of related code'), providing clear context. However, it does not explicitly mention when not to use this tool or suggest alternative tools (e.g., 'semantic_search' for individual queries).

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/lexCoder2/lxDIG-MCP'

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