> ## Documentation Index
> Fetch the complete documentation index at: https://graph.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# workbench__grep

> Searches file contents in the project directory with a regular expression.

* Returns matching lines with their path and line number.
* Skips gitignored and binary files.

| Available to | Effect |
| - | - |
| Workbench agents only | Read-only |

## Input

**case\_insensitive** `boolean`

Case-insensitive matching. Default false.

**glob** `string`

Only search matching files, e.g. *.rs (file name) or src/\*\*/*.rs (relative path).

**max\_matches** `integer`

Stop after this many matches. Default 100, cap 500.

**path** `string`

File or directory to search. Default: the project directory.

**pattern** `string` *required*

Rust regex matched against each line.

## Output

**matchCount** `integer`

**matches** `object[]`

**matches.\[].line** `integer`

**matches.\[].path** `string`

**matches.\[].text** `string`

**truncated** `boolean`

```json Output theme={null}
{
  "matchCount": 1,
  "matches": [
    {
      "line": 42,
      "path": "crates/graph-core/src/tools.rs",
      "text": "pub struct ToolDef {"
    }
  ],
  "truncated": false
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.