For a higher-level overview of all tools and filesystem sandboxing, see Tools.
read — Read File
Read the contents of a file with line numbers.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
path | string | yes | Absolute or relative path to the file |
offset | number | no | Line number to start from (1-indexed) |
limit | number | no | Max number of lines to read (default: 500) |
Returns
Line-numbered text with format:<line_number>\t<content>
Example
Notes
- Maximum 500 lines per read by default
- Use
offsetandlimitfor large files - Returns truncation notice if file has more lines
write — Write File
Create or overwrite a file with the given content.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
path | string | yes | Absolute or relative path to write to |
content | string | yes | File content to write |
Returns
Confirmation message with file path and byte count.Example
Notes
- Parent directories are created automatically
- Overwrites existing files without confirmation
- Use for creating new files or full rewrites
edit — Edit File
Replace a unique string in a file.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
path | string | yes | Absolute or relative path to the file |
old_text | string | yes | Exact text to find and replace (must be unique) |
new_text | string | yes | Replacement text |
Returns
Confirmation message with character counts.Errors
not_found:old_textnot found in filenot_unique:old_textappears multiple times (ambiguous)
Example
Notes
old_textmust appear exactly once in the file- Use
readfirst to verify exact text to replace - For multiple replacements, call
editmultiple times
bash — Execute Shell
Execute a shell command and return its output.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
command | string | yes | Shell command to execute |
timeout | number | no | Timeout in milliseconds (default: 120000) |
Returns
Combined stdout/stderr output, exit code, and timing information.Example
Notes
- Default timeout: 2 minutes
- Runs in the working directory (
cwd) - Use for: tests, git operations, package installs, builds
- Output limited to 30KB (truncated if larger)
- Command killed with SIGTERM on timeout, then SIGKILL after 3s
glob — Find Files
Find files matching a glob pattern.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
pattern | string | yes | Glob pattern (e.g., **/*.ts, src/**/*.js) |
path | string | no | Directory to search in (default: cwd) |
Returns
List of matching file paths (relative to cwd), newline-separated.Example
Notes
- Maximum 200 results
- Uses
findcommand under the hood - Paths returned relative to working directory
grep — Search Code
Search for a regex pattern in files.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
pattern | string | yes | Regex pattern to search for |
path | string | no | File or directory to search in (default: cwd) |
include | string | no | File glob filter (e.g., *.ts) |
Returns
Matching lines with format:<file>:<line_number>:<content>
Example
Notes
- Maximum 100 results
- Uses
grep -rn -Eunder the hood - Regex is extended regex (ERE) format
- Returns “No matches found” if pattern not found
ls — List Directory
List files and directories in a given path.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
path | string | no | Directory to list (default: cwd) |
Returns
List of files and directories (newline-separated). Directories end with/.
Example
Notes
- Directories marked with trailing
/ - Returns all entries (no filtering or pagination)
- Use
globfor pattern-based file finding
Tool Filtering
Restrict tools per-agent usingallowedTools configuration:
allowedTools is not specified, all 9 core tools are available.
Security Considerations
bash Tool
- Runs commands with full shell access
- No sandboxing or command filtering
- Use with trusted agents only
- Consider restricting via
allowedToolsfor untrusted workloads
File Operations
writeandeditcan modify any file in the working directory- No write protection or backup
- Agents can delete files via
bashtool - Consider version control (git) for protection
Best Practices
Reading Large Files
Editing Files
Searching Code
Extended Tool Categories
Beyond the 9 core tools, Polpo offers 7 optional tool categories that can be enabled per-agent via theallowedTools array.
| Category | Tools | Enable via allowedTools | Description |
|---|---|---|---|
| Browser | 18 | "browser_*" | Browser automation via agent-browser CLI |
| 5 | "email_*" | Send emails via SMTP, read via IMAP | |
| Vault | 2 | "vault_*" | Read-only access to agent’s own vault credentials |
| Image | 3 | "image_*" | Image generation (fal.ai FLUX) and vision analysis (OpenAI/Anthropic) |
| Video | 1 | "video_*" | Text-to-video generation via fal.ai Wan 2.2 |
| Audio | 2 | "audio_*" | Speech-to-text (STT) and text-to-speech (TTS) |
| Search | 2 | "search_*" | Semantic web search and similar-page discovery via Exa AI |
Git, multi-file, dependency management, Excel/CSV, PDF, and Word/DOCX tools have been removed as built-in tool categories. Use the
bash tool with appropriate CLI commands or install skills for these operations instead. HTTP tools (http_fetch, http_download) are now always-on core tools — no flag needed.Implementation
Tools are defined insrc/tools/coding-tools.ts using TypeBox schemas for parameter validation.
Each tool implements the AgentTool interface from @mariozechner/pi-agent-core: