read_file
Read the contents of a file. Supports text files and images.| Parameter | Type | Description |
|---|---|---|
path | string | Relative path to the file from the project root |
- Maximum file size: 1 MB for text files, 5 MB for images
- Supported image formats: JPG, PNG, GIF, WebP
- Images are returned as inline attachments for the model to view
- Image files are validated by magic bytes before sending
write_file
Create or overwrite a file with new content.| Parameter | Type | Description |
|---|---|---|
path | string | Relative path to the file |
content | string | The content to write |
- Automatically creates parent directories if they don’t exist
- Scoped to the project directory
edit_file
Replace a specific string in a file.| Parameter | Type | Description |
|---|---|---|
path | string | Relative path to the file |
old_string | string | The exact text to find |
new_string | string | The replacement text |
old_stringmust match exactly once in the file- Fails if zero or multiple matches are found
bash
Execute a shell command in the project directory.| Parameter | Type | Description |
|---|---|---|
command | string | The shell command to run |
timeout | number | Timeout in milliseconds (default: 30000) |
- Default timeout: 30 seconds
- Maximum output: 1 MB
- Runs in the project root directory
- Requires user approval unless auto-approve is enabled in settings
glob
Search for files matching a glob pattern.| Parameter | Type | Description |
|---|---|---|
pattern | string | Glob pattern (e.g., **/*.ts, src/**/*.json) |
- Automatically excludes
node_modules,.git, anddistdirectories - Returns a list of matching file paths
grep
Search file contents for a regular expression pattern.| Parameter | Type | Description |
|---|---|---|
pattern | string | Regex pattern to search for |
include | string | Optional glob filter for file types (e.g., *.ts) |
- Returns the first 50 matching lines with file paths and line numbers
- Equivalent to
grep -rn