tool() helper with Zod schemas. OpenHarness ships a set of built-in tools that you can use as-is, compose, or replace entirely.
Filesystem Tools
Create filesystem tools by passing a provider to the factory function:| Tool | Description |
|---|---|
readFile | Read file contents (supports line offset/limit for large files) |
writeFile | Write content to a file (creates parent directories automatically) |
editFile | Find-and-replace within a file |
listFiles | List files and directories (optionally recursive) |
grep | Regex search across files (automatically skips node_modules, .git) |
deleteFile | Delete a file or directory |
Bash Tool
The bash tool runs arbitrary shell commands viabash -c:
- Configurable timeout (default 30s, max 5min)
- Automatic output truncation for large results
- Captures both stdout and stderr with exit code
Using Tools with an Agent
Pass tools directly to the agent constructor:Providers
The provider interface decouples tool logic from the runtime environment. The built-inNodeFsProvider and NodeShellProvider work in Node.js, but you can implement the interfaces for other environments:
- Virtual filesystems for testing
- E2B sandboxes for isolated execution
- Cloudflare Workers for edge deployment
- Daytona for managed dev environments
FsProvider Interface
ShellProvider Interface
NodeFsProvider includes safety guards like file size limits and binary file detection. NodeShellProvider captures exit code, stdout, and stderr with output size limits.