Skip to main content
Glama

get_module_cluster

Finds files closely related to a target by shared dependencies, ranking modules by Jaccard similarity so you can identify code that works together.

Instructions

Finds files closely related to the target based on shared dependencies.
Uses Jaccard similarity to identify modules that work together.

Args:
    file_path: File path relative to project root
    similarity_threshold: Minimum similarity score 0.0-1.0 (default 0.3)
    max_cluster_size: Maximum number of related files (default 20)

Returns:
    List of related files sorted by similarity score

Input Schema

NameRequiredDescriptionDefault
file_pathYes
max_cluster_sizeNo
similarity_thresholdNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.12.0

TDQS

A3.7/5.0
Behavior3/5

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

With no annotations provided, the description carries the behavioral burden. It discloses the core algorithm, defaults for the optional parameters, and that results are sorted by similarity, but it does not state whether the operation is read-only, mention performance characteristics, or clarify side effects.

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 compact and front-loaded, with purpose stated first and Args/Returns sections used efficiently. Every line adds useful meaning without unnecessary 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?

The tool is a read-style analysis operation with an output schema available, and the description gives enough information about inputs, algorithm, and result ordering for an agent to call it correctly. Some behavioral context, such as performance or relationship to similar sibling tools, is still missing.

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

Parameters4/5

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

Schema description coverage is 0%, so the description must document all parameters. It does so for all three: file_path is relative to project root, similarity_threshold is a 0.0-1.0 score with default 0.3, and max_cluster_size defaults to 20.

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 states a specific verb and resource: finds files closely related to a target based on shared dependencies using Jaccard similarity. This is clear enough to distinguish it from generic search, but it does not explicitly differentiate it from nearby sibling tools such as get_file_relations or get_dependencies_with_depth.

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 implies when to use it by explaining that it identifies modules that work together based on shared dependencies. However, it provides no explicit when-to-use guidance, exclusions, or named alternatives among the sibling dependency and relation tools.

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