search_code_pattern
Search for regular expression patterns across multiple files in a repository, with options to filter by extensions, exclude directories, and use fuzzy matching for flexible code discovery.
Instructions
Search for code patterns across multiple files
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": {
"rootDir": "<rootDir>",
"projectRoot": "<projectRoot>",
"pattern": "<pattern>"
},
"name": "search_code_pattern"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| rootDir | Yes | Repository root directory | |
| projectRoot | Yes | Project root for security boundary | |
| pattern | Yes | Regular expression pattern to search | |
| fileExtensions | No | Extensions to search | |
| excludeDirs | No | Directories to exclude | |
| maxResults | No | Maximum matches to return (default: 10) | |
| startIndex | No | Start index for pagination (default: 0) | |
| fuzzyMatch | No | Enable fuzzy matching (default: false) | |
| fuzzyThreshold | No | Fuzzy match threshold 0-1 (default: 0.4) |