check_duplication
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
| Name | Required | Description | Default |
|---|---|---|---|
| symbol_id | No | Existing symbol ID to check for duplicates (auto-excluded from results — a symbol is never reported as a duplicate of itself) | |
| name | No | Function/class name to check (when symbol_id not available) | |
| kind | No | Symbol kind to narrow search (default: function) | |
| threshold | No | Minimum similarity score to report (default: 0.60) | |
| exclude_symbol_id | No | Suppress 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). |