What are Tools?
Tools are the actions agents can take to interact with the world. They’re how agents read files, execute commands, search the web, and accomplish real tasks. When an agent receives a request, it decides which tools to use, calls them with appropriate parameters, receives the results, and uses that information to continue reasoning or respond to the user.The Tool-Use Loop
Built-in Tools
klaw includes 11 powerful tools out of the box:Command Execution
bash
Execute shell commands with full system access.Features:
- 2-minute default timeout
- Working directory preservation
- Exit code and output capture
- Streaming output for long commands
File Operations
read
Read file contents with line numbers.
write
Create or overwrite files.
edit
Precise string replacement in files.
glob
Find files by pattern.
Search
grep
Search file contents with regex.
web_search
Search the internet.
Web
web_fetch
Fetch and process web content.Features:
- HTML to markdown conversion
- AI-powered content extraction
- Redirect handling
- 15-minute cache
Agent Management
agent_spawn
Create specialized sub-agents.
skill
Install and manage skills.
Scheduling
cron
Schedule recurring tasks.
Tool Schema
Each tool defines a JSON schema for its parameters:Example Schema (bash)
Tool Execution Flow
When an agent calls a tool:Tool Permissions
Control which tools agents can access:Permission Levels
| Level | Tools | Use Case |
|---|---|---|
| Read-only | read, glob, grep | Code review, analysis |
| File ops | + write, edit | Development |
| Full | + bash, web | Automation, devops |
| Admin | + agent_spawn, skill | Agent management |
Custom Tools
Create custom tools by implementing the Tool interface:Tool Output Formatting
Tool results are formatted for LLM consumption:Timeouts and Limits
| Setting | Default | Description |
|---|---|---|
| Tool timeout | 2 minutes | Max execution time per tool |
| Output limit | 30,000 chars | Truncation threshold |
| Concurrent tools | 1 | Tools execute sequentially |
Best Practices
Minimize bash access
Minimize bash access
Only grant bash access when truly needed. Use specific file tools when possible.
Set appropriate timeouts
Set appropriate timeouts
Long-running commands should have explicit timeouts to prevent hanging.
Use working directories
Use working directories
Set workdir to limit file operations to specific directories.
Review tool outputs
Review tool outputs
Tool outputs are visible in the conversation. Sensitive data may be exposed.

