jscpd
OfficialServer Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": false
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| check_duplicationA | Check whether a code snippet duplicates code that already exists in the scanned project. Use it before writing or committing a function, class or block, to find the existing copy you should reuse instead. Detection is token-based with the server's --min-tokens / --min-lines thresholds: a snippet shorter than the threshold returns count 0 with a 'note' explaining why. Returns {format, count, returned, duplications[]} where each duplication has 'file', 'fileStartLine', 'fileEndLine', 'snippetStartLine', 'snippetEndLine', 'tokens' and 'kind' (exact, renamed or similar), biggest match first. With 'similarity' below 1, the response also carries 'similar[]' and 'similarCount': project functions whose syntax-tree structure resembles each function in the snippet (JavaScript/TypeScript only), each with 'file', 'name', line ranges and a 'similarity' ratio. Does not modify the project or the scan; the snippet is compared against the last scan, so call check_current_directory first if files changed. |
| get_file_clonesA | List every clone from the last scan that involves one file, so you know which other files share code with it. Use it before refactoring, splitting or deleting a file, or after editing it (re-scan first with check_current_directory). Returns {file, clones, returned, duplications[]} where each duplication has 'format', 'fileA', 'startA', 'endA', 'fileB', 'startB', 'endB', 'lines', 'tokens' and 'kind', biggest clone first; the requested file may appear as fileA or fileB. A path that was not part of the scan returns clones 0. Read-only. |
| get_statisticsA | Report the duplication statistics of the last scan: for the whole project and per format, the number of files, lines and tokens analyzed, the number of clones, and the duplicated lines and tokens with their percentages. Use it to judge overall duplication or to compare before and after a refactoring (call check_current_directory in between). Takes no arguments and is read-only; it reflects the last scan, not the files on disk right now. |
| check_current_directoryA | Re-scan the paths the server was started with and return the fresh clone list and counts. Use it after creating, editing or deleting files, so that check_duplication, get_file_clones and get_statistics answer from current content. Returns {files, clones, returned, duplications[]} with the same duplication shape as get_file_clones, biggest first. Reads the filesystem only; it never writes. The scan is synchronous and can take a few seconds on large projects; results replace the previous scan entirely. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 4 tools
Each tool targets a distinct workflow stage: refreshing the scan, checking a snippet, listing clones by file, and reporting aggregate statistics. Although check_current_directory also returns a clone list, its refresh role is clearly separated from the query tools by the descriptions.
All tool names use a consistent lowercase snake_case pattern with an imperative verb (check/get) followed by a noun phrase. The naming makes each tool's target and action immediately identifiable.
Four tools is a well-scoped set for a code-duplication server: rescan, snippet-level detection, file-level clone listing, and aggregate statistics. Each tool earns its place without redundancy.
The tool set covers the full workflow: refresh the scan state, then query clones by snippet, by file, or by project statistics. check_current_directory also returns the full clone list, so there is no missing path to raw duplication results.