search_in_file
Search for string or regex patterns in a file. Specify file path and pattern to find matching lines with context and match limits.
Instructions
Search pattern in file. Regex supported.
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_in_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file | No | Relative path (also accepts file_path) | |
| pattern | Yes | Pattern (string/regex) | |
| file_path | No | Alias for file | |
| max_matches | No | Max matches (default: 50) | |
| context_lines | No | Context lines (default: 2) |