find_similar_code
Find code elements similar to a specified function or class using vector similarity. Requires a code element ID from previous queries.
Instructions
Find code elements similar to a given function or class by vector similarity. Requires elementId — use the id field returned by graph_query or code_explain (not a symbol name or natural language string). Optionally set threshold (0–1, default 0.7) and limit. Returns similar elements with names and file paths.
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": {
"elementId": "<elementId>"
},
"name": "find_similar_code"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| elementId | Yes | Code element ID | |
| threshold | No | Similarity threshold (0-1) | |
| limit | No | Result limit | |
| profile | No | Response profile | compact |