search_code
Search file contents by regex or plain text to locate code matches and return path, line, and text, with optional file pattern filtering.
Instructions
Search file contents with a regular expression (or literal=true for plain text). Returns path:line:text. file_pattern filters names, e.g. *.ts.
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": {
"path": "<path>",
"pattern": "<pattern>"
},
"name": "search_code"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | ||
| literal | No | ||
| pattern | Yes | ||
| timeout_ms | No | Milliseconds to wait for output. | |
| ignore_case | No | ||
| max_results | No | ||
| file_pattern | No | ||
| context_lines | No | ||
| include_hidden | No |