Skip to main content
The AI agent has six built-in tools for interacting with your project. These tools are available in every session.

read_file

Read the contents of a file. Supports text files and images.
ParameterTypeDescription
pathstringRelative 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.
ParameterTypeDescription
pathstringRelative path to the file
contentstringThe 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.
ParameterTypeDescription
pathstringRelative path to the file
old_stringstringThe exact text to find
new_stringstringThe replacement text
  • old_string must match exactly once in the file
  • Fails if zero or multiple matches are found

bash

Execute a shell command in the project directory.
ParameterTypeDescription
commandstringThe shell command to run
timeoutnumberTimeout 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.
ParameterTypeDescription
patternstringGlob pattern (e.g., **/*.ts, src/**/*.json)
  • Automatically excludes node_modules, .git, and dist directories
  • Returns a list of matching file paths

grep

Search file contents for a regular expression pattern.
ParameterTypeDescription
patternstringRegex pattern to search for
includestringOptional glob filter for file types (e.g., *.ts)
  • Returns the first 50 matching lines with file paths and line numbers
  • Equivalent to grep -rn

MCP tools

If you have MCP servers configured, their tools appear alongside the built-in tools. The agent can call MCP tools the same way it calls built-in tools.