search_code
Search a repository for text or regex queries and return matching file paths, line numbers, and lines, with optional include/exclude globs to narrow results.
Instructions
Search the repository for a text or regex query; returns path, line number, and the matching line.
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": "search_code"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | ||
| regex | No | ||
| exclude | No | Glob patterns to exclude | |
| include | No | Glob patterns to include, e.g. ['*.py', 'src/**'] | |
| max_results | No |