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, and apply_patch for interacting with the filesystem.
  • Execution Tools: exec, process, and bash for running commands and scripts on the host.
  • Browser Tools: Multi-profile browsing with snapshots, screenshots, and the act command for page interaction.
  • Web Tools: web_search for querying search engines and web_fetch for retrieving page content.
  • Messaging Tools: Cross-platform message sending to communicate across services.
  • Session Tools: list, history, send, and spawn for managing concurrent agent sessions.
  • Node Tools: camera and screen for capturing visual input from hardware devices.
  • Automation Tools: cron for scheduled tasks and gateway for webhook-driven triggers.
  • Image Tools: Image generation and manipulation capabilities.
  • Memory Tools: memory_search and memory_get for 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 exec when web_fetch suffices: If you only need to retrieve a web page, do not spawn a full browser or curl subprocess. Use web_fetch directly.
  • Confusing write with edit: The write tool overwrites the entire file. If you only need to change a few lines, use edit or apply_patch to avoid data loss.
  • Ignoring yieldMs on long commands: Without yieldMs, a long-running exec call blocks the agent. Set it to allow background execution.

Best Practices

  • Choose the lightest tool for the job: Prefer web_fetch over browser automation when you do not need JavaScript rendering or interaction.
  • Use apply_patch for complex edits: When modifying multiple sections of a file, a patch is more reliable and auditable than multiple edit calls.
  • Leverage memory_search for 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 yieldMs parameter on exec enables non-blocking execution of long-running commands.
  • web_fetch and web_search provide lightweight web access without full browser overhead.
  • Choosing the right category keeps workflows efficient, secure, and maintainable.
✓ Completed