๐Ÿš€
Stage 1 ยท Lesson 4 of 5

Tools โ€” What Your Agent Can Do

Built-in tools: file read/write, bash execution, web search. Granting and restricting tool access.

~20 min read7 walkthrough steps

Tools are what make an agent an agent instead of a chatbot. OpenClaw comes with built-in tools that let your agent interact with the real world โ€” your filesystem, your terminal, and the web. Understanding these tools is understanding what your agent is capable of.

File tools are the foundation. Your agent can read files, write files, edit specific sections, search for patterns, and navigate directory structures. This means your agent can review code, modify configurations, create documents, update logs โ€” anything that involves files on your machine. When you ask your agent to "refactor the error handling in server.ts," it reads the file, understands the code, makes the changes, and writes the result back.

Bash tools give your agent access to your terminal. It can run commands, check output, chain operations together. This is powerful and potentially dangerous in equal measure. Your agent can run your test suite, start development servers, check git status, install packages, or deploy code. The key is explicit guidance in your agents.md about which bash operations are acceptable and which require your approval first.

Web search lets your agent find current information. API documentation, package versions, error message solutions, competitor analysis โ€” anything on the public web. The agent searches, reads the results, and synthesizes them into its response. This is particularly useful for research tasks where the agent needs information beyond its training data.

The critical concept here is tool guidance. Don't just enable tools โ€” tell your agent when and how to use them. "When debugging, always check the test output before modifying code." "When creating files, always verify the target directory exists first." "Use web search when you encounter an error you can't diagnose from the codebase alone." This guidance turns a tool-wielding agent from unpredictable to reliable.

Walkthrough

  1. 1
    Check which tools are enabled in your openclaw.json configuration
  2. 2
    Ask your agent: 'What tools do you have access to?' โ€” it should list its capabilities
  3. 3
    Test file tools: ask your agent to 'Read the contents of agents.md and summarize it'
  4. 4
    Test bash tools: ask your agent to 'Run ls -la in the workspace and describe what you see'
  5. 5
    Test web search: ask your agent to 'Search for the latest version of TypeScript and tell me what's new'
  6. 6
    Add tool guidance to your agents.md: specify when to use each tool and any restrictions
  7. 7
    Run a practical multi-tool task: 'Create a project summary by reading all .md files in the workspace and compiling a report'

Checkpoint

You understand all three tool categories (file, bash, web), have tested each one, and have added tool usage guidance to your agents.md.