Skip to main content
Glama

detect_clones

Find duplicate or near-duplicate functions in a repository. Detects exact copies and copies with renamed variables to identify code clones.

Instructions

Find duplicate or near-duplicate functions in the repo.

Detects Type 1 (exact copies) and Type 2 (copies with renamed variables).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_pathNooptional — if given, find clones of functions in this file.
min_linesNominimum function line count to consider (default 5).

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior3/5

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

No annotations are provided. The description discloses that it detects Type 1 and Type 2 clones, offering some behavioral scope. However, it does not mention limitations (e.g., sensitivity, file size), performance characteristics, or side effects. Since it is a read-only operation, the missing detail is acceptable but not ideal.

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 only two sentences: first states the purpose, second specifies clone types. It is efficient and front-loaded. However, it could benefit from a brief mention of output or usage scenario.

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 presence of an output schema and the tool's relatively simple domain, the description covers the essential behavior. It distinguishes from siblings adequately. A more complete description might include examples or performance notes, but the current version is sufficient.

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 have descriptions). The description adds value beyond the schema by clarifying the types of clones detected, which is not in the parameter descriptions. Baseline 3 with minor added value, so score remains 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 the tool finds duplicate/near-duplicate functions, specifically Type 1 and Type 2 clones. It uses a specific verb ('Find') and resource ('functions in the repo'), and the clone types differentiate it from siblings like 'find_references' or 'get_call_graph'.

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 gives basic usage (finding duplicates) but lacks explicit guidance on when to use this tool versus alternatives like 'find_references' or 'get_complexity'. It does not mention when not to use it or prerequisites.

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/ThinkyMiner/codeTree'

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