Search file contents
grepSearch workspace files with a JavaScript regex, returning matches as relative/path:LINE. Use it to locate symbols, strings, or patterns across a project.
Instructions
Search file contents in the workspace with a JavaScript regular expression and return matches as 'relative/path:LINE: '. Use this to find where a symbol, string or pattern appears. Narrow the search with path and include. Skips binary files and the .git, node_modules and .cache directories. Do not use it to list files (use list_files) or to read a known file (use read_file).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | No | File or directory to search, workspace-relative. Defaults to the workspace root. | |
| include | No | Glob filter for file paths, e.g. '*.ts' or 'src/**/*.ts'. Patterns without a slash match the file name at any depth. | |
| pattern | Yes | JavaScript regular expression source, e.g. 'function\s+main' or 'TODO:'. Not a shell glob. | |
| workspace | No | Workspace name (see workspace_list). Defaults to the primary workspace. | |
| ignoreCase | No | Case-insensitive matching. Defaults to false. | |
| maxResults | No | Maximum number of matching lines to return. Defaults to 100 and is capped at 1000. |