Import
Tool Factories
All tools are created using factory functions that accept a working directory and optional configuration.createReadTool
Create a tool for reading file contents.string
required
Working directory for file operations
ReadToolOptions
- Reads text files and images (jpg, png, gif, webp)
- Auto-truncates to 2000 lines or 50KB
- Supports offset/limit for large files
- Images sent as base64 attachments
createWriteTool
Create a tool for writing file contents.string
required
Working directory for file operations
WriteToolOptions
- Creates parent directories automatically
- Overwrites existing files
- Returns confirmation message
createEditTool
Create a tool for editing files using exact string replacement.string
required
Working directory for file operations
EditToolOptions
- Exact string matching (no regex)
- Fails if
oldStringnot found - Fails if multiple matches without
replaceAll - Shows unified diff of changes
createBashTool
Create a tool for executing bash commands.string
required
Working directory for command execution
BashToolOptions
- Executes in persistent shell session
- Streams output in real-time
- Preserves environment variables
- Auto-truncates output to 2000 lines or 50KB
createGrepTool
Create a tool for searching file contents using regex.string
required
Working directory for search operations
- Full regex support
- File filtering by glob pattern
- Returns file paths and line numbers
- Fast implementation using ripgrep
createFindTool
Create a tool for finding files by name pattern.string
required
Working directory for search operations
- Glob pattern matching
- Sorted by modification time
- Works with any codebase size
createLsTool
Create a tool for listing directory contents.string
required
Working directory for file operations
- Shows file sizes and types
- Supports recursive listing
- Sorted output
Pre-built Tool Sets
codingTools
All tools for full file system access.read, write, edit, bash, grep, find, ls
createCodingTools
Factory for creating coding tools with custom working directory.readOnlyTools
Read-only tools (no write, edit, or bash).read, grep, find, ls