Near-duplicate function pairs
list_duplicate_functionsFind near-duplicate function pairs in the newest run (up to 50) before refactoring so duplicate code can be merged.
Instructions
Lists near-duplicate function pairs in the newest run, at most 50. Use it before a refactor so twins are folded together, and get_function_brief for one function's twins. It reads the run's stored index, whose first build takes seconds on a large repo, skips functions with under 8 lines of their own and nested pairs, and an empty list means no pair reached similarity. similarity is shared shingles over the smaller function: 1.0 admits only a function found whole inside another, 0.8 four lines in five, and repo may be any directory under the checkout.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "list_duplicate_functions"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| repo | No | path to the scored repo's root (default: the repo the server was started in); a leading ~ is the home directory | |
| similarity | No | containment threshold, shared over smaller, 0 to 1 (default 0.8) |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pairs | No | pairs at or above similarity, best containment first, at most 50 | |
| run_id | No | the newest run whose rows were compared | |
| schema | No | payload schema version, 1 | |
| truncated | No | present only when the whole answer was longer than one tool result the server sends (7,500 characters): each list, string or object field it cut, at any depth, keeps its start, and full is the CLI command that prints the whole answer |