Skip to main content
Glama

find_shared_behaviors

Identify clusters of CLI commands, MCP tools, and VS Code commands that share the same underlying behavior, revealing cross-modality duplication in your codebase.

Instructions

List clusters of FEATUREs whose entry-points share an identical BEHAVIOR (same forward-slice hash).

Surfaces cross-modality duplication — e.g. "this CLI command is a thin wrapper around the same library function as that HTTP endpoint" or "this MCP tool and that VS Code command delegate to identical logic".

Each cluster contains:

  • hash: sha256 of the shared transitive call set (BEHAVIOR.metadata.hash)

  • effects: transitive effects (IO, MUTATION, …) attributed to the shared behavior

  • coreNodeCount: size of the shared forward slice

  • features: array of { id, type, name, file } — the FEATUREs that share this behavior

Cluster types are FEATURE node types: cli:command, mcp:tool, vscode:command (and any future domain types created by enrichers).

Returns clusters ordered by size (largest first), then hash (deterministic tie-break). Empty result means every FEATURE has a unique implementation.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
minClusterSizeNoMinimum FEATUREs per cluster (default: 2). Values below 2 are clamped to 2.
limitNoMaximum clusters to return (default: 100).
Behavior4/5

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

No annotations are provided, so the description carries full burden. It discloses return order, fields like hash and effects, and empty result interpretation. It does not mention cost or limitations, but for a read-only tool, it is fairly transparent.

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 bullet points for output fields, and front-loaded with purpose. While slightly long, every sentence adds value.

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?

Tool has two optional parameters and no output schema, but the description explains the output structure in detail (cluster fields like hash, effects, features). This compensates well for lack of output schema.

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 description coverage is 100% (both parameters described in schema). The description adds no extra meaning beyond the schema, matching the baseline of 3.

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 lists clusters of FEATUREs with identical behavior (forward-slice hash). It uses specific verb 'list' and resource 'clusters of FEATUREs', and distinguishes from sibling tools like 'find_calls' by focusing on cross-modality duplication.

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 usage for detecting duplication (e.g., CLI commands wrapping same library as HTTP endpoints) but does not explicitly state when to use this tool over alternatives or when not to use it. No direct comparisons or exclusions are provided.

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/Disentinel/grafema'

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