d_find_similar_code
Find semantically similar code patterns in the codebase to detect duplicates, understand patterns, and identify refactoring opportunities.
Instructions
Find similar code patterns in the codebase. Given a code snippet, returns other code chunks that are semantically similar. Useful for finding duplicate code, understanding patterns, and refactoring opportunities.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"code": "<code>"
},
"name": "d_find_similar_code"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | The code snippet to find similar patterns for | |
| maxResults | No | Maximum number of similar code chunks to return (default: 5) | |
| minSimilarity | No | Minimum similarity threshold 0-1 (default: 0.3 = 30%) |