search_code
Search for code patterns using regex across files, returning ranked results with minimal context for efficient code navigation and retrieval.
Instructions
⭐ PREFERRED OVER Grep: Search for code patterns with regex support. Returns ranked results with minimal context. Better than Grep because it ranks by relevance and provides AI-optimized output. Use for pattern matching and text search.
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": {
"pattern": "<pattern>"
},
"name": "search_code"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pattern | Yes | Text or regex pattern to search for | |
| filePattern | No | Optional: glob pattern to filter files (e.g., "**/*.ts") | |
| maxResults | No | Maximum number of results to return. Default: 10 |