The agent has access to tools for filesystem operations, shell execution, web access, browser automation, knowledge management, scheduling, and sub-agent spawning. Tools are registered dynamically — some only appear when dependencies are available (e.g., browser requires Playwright).
Filesystem¶
All filesystem tools resolve paths relative to the workspace by default. Use short relative paths like data/config.json instead of full absolute paths — the tools will resolve them against the workspace directory automatically. Absolute paths (/etc/hosts) and tilde paths (~/file.txt) bypass workspace resolution and work as-is.
read_file¶
Read file contents. Respects PathGuard access control.
| Parameter | Required | Description |
|---|---|---|
path |
Yes | File path (relative to workspace, or absolute) |
write_file¶
Write content to a file. Creates parent directories automatically.
| Parameter | Required | Description |
|---|---|---|
path |
Yes | File path (relative to workspace, or absolute) |
content |
Yes | Content to write |
edit_file¶
Replace exact text in a file. The old_text must match exactly once — if it matches zero times or more than once, the edit fails with an error.
| Parameter | Required | Description |
|---|---|---|
path |
Yes | File path (relative to workspace, or absolute) |
old_text |
Yes | Exact text to find |
new_text |
Yes | Replacement text |
list_dir¶
List directory contents with type indicators.
| Parameter | Required | Description |
|---|---|---|
path |
Yes | Directory path (relative to workspace, or absolute) |
Shell¶
exec¶
Execute a shell command via asyncio.create_subprocess_shell.
| Parameter | Required | Description |
|---|---|---|
command |
Yes | Shell command to run |
workingDir |
No | Working directory (default: workspace) |
Safety guards:
- Deny patterns: rm -r, del /f, format, dd, shutdown, fork bomb, and more
- Path guard: Detects path traversal (../), checks against PathGuard rules
- Timeout: Configurable (default 60s), kills process on timeout
- Output truncation: Capped at 10,000 characters
Configure deny/allow patterns in tools.exec config.
Web¶
web_search¶
Search the web via Brave Search API.
| Parameter | Required | Description |
|---|---|---|
query |
Yes | Search query |
max_results |
No | Results to return (1-10, default 5) |
Requires BRAVE_API_KEY environment variable or tools.web.search.apiKey in config.
web_fetch¶
Fetch a URL and extract readable content using Readability.
| Parameter | Required | Description |
|---|---|---|
url |
Yes | URL to fetch (http/https) |
Returns clean markdown with links preserved. HTML is processed through Readability for article extraction. JSON responses are pretty-printed. Content truncated to 50,000 characters.
firecrawl_scrape¶
Scrape a URL to clean markdown via the Firecrawl API. Better than web_fetch for JavaScript-heavy pages.
| Parameter | Required | Description |
|---|---|---|
url |
Yes | URL to scrape |
Requires FIRECRAWL_API_KEY environment variable or tools.web.firecrawl.apiKey in config.
firecrawl_search¶
Search the web and optionally scrape results.
| Parameter | Required | Description |
|---|---|---|
query |
Yes | Search query |
max_results |
No | Results (1-10) |
scrape |
No | Scrape result pages (default false) |
Browser¶
browser¶
Control a web browser via Playwright. Requires playwright optional dependency:
uv pip install -e ".[browser]"
playwright install chromium
The browser launches lazily on first use and is cleaned up when the agent loop exits.
Actions:
| Action | Parameters | Description |
|---|---|---|
navigate |
url |
Go to a URL |
click |
selector |
Click an element |
type |
selector, text, clear(=true) |
Type into an input |
screenshot |
selector(opt), fullPage(=false) |
Take a screenshot |
get_text |
selector(opt) |
Get text content (truncated to 4000 chars) |
evaluate |
expression |
Run JavaScript in page context |
select |
selector, value |
Select a dropdown option |
wait_for |
selector, state(=visible), timeout |
Wait for element state |
get_elements |
selector, limit(=20) |
Get element details |
States for wait_for: attached, detached, visible, hidden
Screenshots are saved to ~/.picobot/data/screenshots/ as PNG files, with a base64 preview returned to the agent.
Configuration:
{
"tools": {
"browser": {
"headless": true,
"timeout": 30000,
"viewportWidth": 1280,
"viewportHeight": 720
}
}
}
Set headless: false to watch the browser in action.
Knowledge Base¶
kb¶
Interface to the persistent knowledge base. See Knowledge Base for full details.
| Action | Parameters | Description |
|---|---|---|
read |
path |
Read an entry by relative path |
store |
topic, title, content, tags(opt) |
Store a new entry |
search |
query, topic(opt) |
Search entries |
topics |
— | List all topics with entry counts |
sync |
— | Sync KB with git remote |
Scheduling¶
cron¶
Schedule recurring tasks. See Scheduling for full details.
| Action | Parameters | Description |
|---|---|---|
add |
message, every_seconds or cron_expr |
Create a scheduled job |
list |
— | List all jobs |
remove |
job_id |
Remove a job |
Sub-agents¶
spawn¶
Launch a background sub-agent. See Sub-agents for full details.
| Parameter | Required | Description |
|---|---|---|
task |
Yes | Task description for the sub-agent |
label |
No | Short label for display |
check_subagents¶
Query sub-agent status.
| Action | Parameters | Description |
|---|---|---|
list |
— | Show all sub-agents for current session |
check |
id |
Get detailed status of a specific sub-agent |
Path Access Control¶
All filesystem and shell tools are governed by PathGuard. Two modes:
Unrestricted (default): All paths allowed, except those in blockPaths.
Workspace-restricted: Only workspace paths allowed, plus exceptions in allowPaths. Block list always wins.
{
"tools": {
"restrictToWorkspace": true,
"allowPaths": ["/Users/me/projects"],
"blockPaths": ["/Users/me/.ssh", "/etc"]
}
}
Workspace-relative path resolution¶
Filesystem tools (read_file, write_file, edit_file, list_dir) resolve relative paths against the workspace directory. This means:
| Path given | Resolved to |
|---|---|
data/config.json |
<workspace>/data/config.json |
/etc/hosts |
/etc/hosts (absolute — unchanged) |
~/notes.txt |
$HOME/notes.txt (tilde-expanded) |
This saves tokens — the agent uses data/config.json instead of /home/user/.picobot/workspace/data/config.json. The system prompt tells the agent to prefer relative paths, and sub-agent preambles include the same guidance.
The shell tool (exec) also checks relative path tokens in commands against PathGuard. In workspace-restricted mode, a command like cat ../../etc/passwd is blocked because ../../etc/passwd resolves outside the workspace. URL-like strings (https://...) are not treated as path traversal.