Skip to main content
Glama

check_duplication

Read-onlyIdempotent

Check whether a function or class name is already used in the codebase before creating it, preventing duplicate logic. Returns similarity scores to identify potential duplicates.

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 (an existing match means the name is taken — this is expected when used as a pre-create check), or symbol_id to check an existing symbol against others (the supplied symbol_id is always excluded from results — a symbol is never its own duplicate). Use exclude_symbol_id to suppress additional known symbols. Returns scored matches — score ≥0.7 means high likelihood of duplication, review the existing symbol before proceeding. Read-only. Returns JSON: { duplicates: [{ symbol_id, name, file, score }], hasDuplication }.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
symbol_idNoExisting symbol ID to check for duplicates (auto-excluded from results — a symbol is never reported as a duplicate of itself)
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)
exclude_symbol_idNoSuppress specific symbol(s) from results. Useful in name-only mode to exclude a known canonical match (e.g. when checking before adding a sibling symbol).
Behavior5/5

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

The description adds significant behavioral context beyond annotations: read-only confirmation, auto-exclusion of supplied symbol_id, score interpretation (≥0.7 high likelihood), and return JSON format. No contradictions.

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 comprehensive and front-loaded with the main purpose. Each sentence adds important information, though slightly verbose. It could be tightened without losing clarity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (5 params, no output schema), the description covers all essential aspects: use cases, parameter behavior, scoring, and return format. It is complete and actionable.

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

Parameters5/5

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

Schema coverage is 100% with detailed parameter descriptions. The description adds value by explaining combined usage (name vs symbol_id), exclusion semantics, and default threshold, enhancing understanding beyond the schema.

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 checks for duplicate function/class names, with specific verb (check) and resource (existence in codebase). It distinguishes from siblings by focusing on duplication detection, and provides a concise purpose.

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 gives explicit usage patterns: using 'name' for pre-create checks and 'symbol_id' for existing symbols, with exclusion behavior explained. It lacks direct mention of alternatives but the context is clear.

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