Search Code
search_codeSearch codebases for text or regex patterns with ripgrep, noise exclusion, and optional context lines to quickly find relevant code.
Instructions
Search for a text or regex pattern across codebase with ripgrep, noise exclusion, and context lines.
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 |
|---|---|---|---|
| path | No | Directory to search in (default: current directory). | . |
| pattern | Yes | The text or regex pattern to search for. | |
| glob_filter | No | Optional file pattern filter (e.g. '*.py', '*.ts', '*.{ts,js}'). | |
| max_results | No | Maximum number of result lines to return. | |
| context_lines | No | Number of surrounding context lines to show (0 = match line only). | |
| case_sensitive | No | If True, enforces strict case sensitivity. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |