find_similar
Find code semantically similar to a snippet before writing a function to check if equivalent logic already exists. Use dense search when you have code to compare, not when describing needs in words.
Instructions
Code semantically similar to a snippet you already have, dense search only: use it before writing a function, to check whether something like it exists. search is the one to call when you can describe the need in words instead. Snippets are cut at 2000 chars.
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": {
"snippet": "<snippet>"
},
"name": "find_similar"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| top_k | No | Max results. | |
| source | No | Source name. Omit when only one source applies. | |
| snippet | Yes | Code block to match; cut at 2000 chars. |