Skip to main content
Glama

check_duplication

Check for duplicate function or class names in your codebase before creating new code. Prevents logic duplication by identifying existing symbols with similar names and scoring their similarity.

Instructions

Check if a function/class name already exists elsewhere in the codebase before creating it. Prevents duplicating existing logic. Call with just a name when planning new code, or symbol_id to check an existing symbol. Returns scored matches — score ≥0.7 means high likelihood of duplication, review the existing symbol before proceeding.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
symbol_idNoExisting symbol ID to check for duplicates
nameNoFunction/class name to check (when symbol_id not available)
kindNoSymbol kind to narrow search (default: function)
thresholdNoMinimum similarity score to report (default: 0.60)
Behavior4/5

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

With no annotations provided, the description carries full burden and delivers well: it explains the tool's purpose (prevent duplication), scoring behavior (returns scored matches), interpretation threshold (score ≥0.7 means high likelihood), and recommended action (review existing symbol). It doesn't mention rate limits, authentication needs, or error conditions, but covers core behavioral aspects adequately.

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?

Three sentences with zero waste: first states purpose, second explains parameter usage, third interprets results. Each sentence earns its place by providing essential guidance. The description is appropriately sized and front-loaded with the core purpose.

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?

For a 4-parameter tool with no annotations and no output schema, the description does well: it explains purpose, usage scenarios, and result interpretation. It could mention return format or error cases, but given the schema's 100% coverage and the clear behavioral context, it's mostly complete. The absence of output schema is partially compensated by the score interpretation guidance.

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%, so the schema already documents all parameters thoroughly. The description adds minimal value beyond schema: it clarifies the name/symbol_id choice scenario but doesn't provide additional syntax, format, or semantic details. Baseline 3 is appropriate when schema does the heavy lifting.

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 specific verb ('check if... already exists') and resource ('function/class name'), with explicit purpose ('prevents duplicating existing logic'). It distinguishes from siblings by focusing on duplication detection rather than analysis, refactoring, or search tools.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicit guidance is provided on when to use ('when planning new code') and how to choose between parameters ('call with just a name when planning new code, or symbol_id to check an existing symbol'). The description also specifies when to review results ('score ≥0.7 means high likelihood of duplication, review the existing symbol before proceeding').

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/nikolai-vysotskyi/trace-mcp'

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