Semantic Code Search
semantic_searchSearch a codebase using natural language to find relevant implementations, usage patterns, and related code by meaning rather than keywords; indexes on first use.
Instructions
Search code semantically using natural language queries. Finds relevant code by understanding meaning, not just keywords. Useful for finding implementations, usage patterns, or related code. On first use, indexes the codebase (may take a moment for large projects).
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": {
"query": "<query>"
},
"name": "semantic_search"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | No | Optional directory path to scope the search | |
| limit | No | Maximum number of results to return (default: 10) | |
| query | Yes | Natural language query describing what you are looking for | |
| file_pattern | No | Optional glob pattern to filter files (e.g., "*.ts", "**/*.py") | |
| use_reranking | No | Use cross-encoder reranking for better precision (default: true) | |
| candidate_multiplier | No | Candidate multiplier for reranking, 1-20 (default: 5) |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | The original search query | |
| results | Yes | Array of matching code chunks | |
| totalResults | Yes | Number of results returned |