Introduction
OpenClaw provides a rich set of tool categories that allow agents to interact with files, execute processes, browse the web, send messages, and much more. Understanding what each category does and when to reach for it is the foundation for building effective automations. This lesson maps out every major tool category so you can choose the right tool for any task.
Key Concepts
- File Operations Tools:
read,write,edit, andapply_patchfor interacting with the filesystem. - Execution Tools:
exec,process, andbashfor running commands and scripts on the host. - Browser Tools: Multi-profile browsing with
snapshots,screenshots, and theactcommand for page interaction. - Web Tools:
web_searchfor querying search engines andweb_fetchfor retrieving page content. - Messaging Tools: Cross-platform message sending to communicate across services.
- Session Tools:
list,history,send, andspawnfor managing concurrent agent sessions. - Node Tools:
cameraandscreenfor capturing visual input from hardware devices. - Automation Tools:
cronfor scheduled tasks andgatewayfor webhook-driven triggers. - Image Tools: Image generation and manipulation capabilities.
- Memory Tools:
memory_searchandmemory_getfor persisting and retrieving knowledge across sessions.
Real World Context
Consider a CI/CD pipeline agent that monitors a repository, runs builds via exec, reads log files with read, searches documentation with web_search, and posts status updates through messaging. Each step maps to a distinct tool category, and choosing correctly keeps the workflow efficient and secure.
Deep Dive
OpenClaw organizes its tools into logical categories. Each category groups related operations so that access control and permissions can be applied at the right granularity.
File Operations
The file ops category includes four tools:
json{ "tool": "read", "path": "/app/config.yaml" }
The above call reads the contents of a file at the given path. The read tool returns the raw text content, which the agent can then parse or analyze.
json{ "tool": "write", "path": "/app/config.yaml", "content": "port: 8080\nhost: 0.0.0.0" }
This call writes content to a file, creating it if it does not exist or overwriting if it does. Use edit for targeted replacements within a file and apply_patch for diff-based modifications.
Execution Tools
The execution category lets agents run commands on the host system:
json{ "tool": "exec", "command": "npm run build", "timeout": 30000, "yieldMs": 5000 }
This executes the npm run build command with a 30-second timeout. The yieldMs parameter tells the system to automatically background the process if it runs longer than 5 seconds, allowing the agent to continue other work. The bash tool is a convenience wrapper around exec for shell commands, while process manages long-running processes.
Web Tools
For information retrieval without a full browser:
json{ "tool": "web_search", "query": "OpenClaw tool categories documentation" }
This performs a search engine query and returns summarized results. It is lighter weight than launching a browser session.
json{ "tool": "web_fetch", "url": "https://docs.openclaw.ai/tools" }
This fetches the raw content of a URL, useful when you already know the exact page you need.
Memory Tools
Memory tools enable persistent knowledge across sessions:
json{ "tool": "memory_search", "query": "database migration steps" }
This searches previously stored memories for relevant information. The agent can store facts during one session and retrieve them later with memory_get using a specific key.
Common Pitfalls
- Using
execwhenweb_fetchsuffices: If you only need to retrieve a web page, do not spawn a full browser or curl subprocess. Useweb_fetchdirectly. - Confusing
writewithedit: Thewritetool overwrites the entire file. If you only need to change a few lines, useeditorapply_patchto avoid data loss. - Ignoring
yieldMson long commands: WithoutyieldMs, a long-runningexeccall blocks the agent. Set it to allow background execution.
Best Practices
- Choose the lightest tool for the job: Prefer
web_fetchover browser automation when you do not need JavaScript rendering or interaction. - Use
apply_patchfor complex edits: When modifying multiple sections of a file, a patch is more reliable and auditable than multipleeditcalls. - Leverage
memory_searchfor recurring tasks: Store important findings so future sessions can skip redundant research.
Summary
- OpenClaw tools are organized into categories: File Ops, Execution, Browser, Web, Messaging, Sessions, Nodes, Automation, Image, and Memory.
- Each category serves a distinct purpose, from filesystem manipulation to persistent knowledge storage.
- The
yieldMsparameter onexecenables non-blocking execution of long-running commands. web_fetchandweb_searchprovide lightweight web access without full browser overhead.- Choosing the right category keeps workflows efficient, secure, and maintainable.