search_in_file
Locate code in remote files by searching for a pattern with grep, which returns matches with line numbers and context.
Instructions
Search for a text pattern in a remote file using grep. Returns matching lines with line numbers and surrounding context. Use this to locate code sections before editing.
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": {
"server": "<server>",
"path": "<path>",
"pattern": "<pattern>"
},
"name": "search_in_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | File path | |
| server | Yes | Server name | |
| pattern | Yes | Grep regex pattern | |
| max_matches | No | Maximum number of matches | |
| context_lines | No | Lines of context around each match |