# FindRequest

Request for finding files with optional glob pattern and content search. Designed for AI agents that need to explore and search filesystems efficiently.

**Kind:** an object, used in requests.

## Fields

| Field | Type | Required | Description |
|---|---|---|---|
| `path` | `string` |  | Starting directory path. Defaults to "/" (root). |
| `pattern` | `string \| null` |  | Glob pattern to match files (e.g., "**/*.cs", "src/**/*.ts"). Supports *, **, ?, [abc], {a,b} patterns. |
| `grep` | `string \| null` |  | Search pattern for file contents. If specified, only files containing this pattern are returned. |
| `grepMode` | `string` |  | How to interpret the grep pattern: "literal" (default) or "regex". |
| `ignoreCase` | `boolean` |  | Case-insensitive search for grep. Default false. |
| `contextLines` | `integer` |  | Number of lines before and after each grep match to include as context. |
| `includePreview` | `boolean` |  | If true, include a preview of each file's content (first N lines). |
| `previewLines` | `integer` |  | Number of lines to include in preview. Default 30. |
| `maxResults` | `integer` |  | Maximum number of results to return. Default 100. |
| `maxDepth` | `integer` |  | Maximum recursion depth. Default -1 (unlimited). |
| `type` | `string` |  | Filter by entry type: "file", "directory", or "all". Default "file". |
| `includeHidden` | `boolean` |  | Include hidden files/directories (starting with .). Default false. |

## Example

```json
{
  "path": "...",
  "pattern": "...",
  "grep": "...",
  "grepMode": "...",
  "ignoreCase": false,
  "contextLines": 0,
  "includePreview": false,
  "previewLines": 0,
  "maxResults": 0,
  "maxDepth": 0,
  "type": "...",
  "includeHidden": false
}
```

## Where it's used

- [`vfs.open(name).find`](https://docs.maitento.com/reference/api/vfs.md) (`POST /namespaces/{namespaceName}/vfs/by-name/{name}/find`)
- [`vfs.openById(id).find`](https://docs.maitento.com/reference/api/vfs.md) (`POST /vfs/by-id/{id}/find`)
