search_in_files
Search for text or regular expressions in files within a directory. Use file patterns to filter files, with options for case sensitivity and hidden files.
Instructions
Searches for text content within files in a directory.
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": {
"directory": "<directory>",
"pattern": "<pattern>",
"searchText": "<searchText>"
},
"name": "search_in_files"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| isRegex | No | If true, treat searchText as a regular expression | |
| pattern | Yes | File pattern to match (e.g., '*.swift', '*.{js,ts}') | |
| directory | Yes | Directory to search in. Can be absolute, relative to active directory, or use ~ for home directory. | |
| maxResults | No | Maximum number of results to return | |
| searchText | Yes | Text or regular expression to search for within the files | |
| caseSensitive | No | If true, perform a case-sensitive search | |
| includeHidden | No | If true, include hidden files in the search |