searchFiles
Search files in a directory for text or regex patterns, optionally filter by file type and recurse subdirectories, then return matches with surrounding context.
Instructions
Searches for text patterns within files in a directory using regular expressions. Returns matches with context.
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>",
"path": "<path>"
},
"name": "searchFiles"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Directory to search | |
| query | Yes | Search pattern (text or regex) | |
| fileTypes | No | Filter by file extensions (e.g., ["txt", "md"]) | |
| recursive | No | Search subdirectories (default: true) | |
| maxResults | No | Maximum results to return (default: 50) | |
| caseSensitive | No | Case-sensitive search (default: false) |