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 12 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 persistent agent bindings for the orchestrator.
delegate
Spawn an ephemeral sub-agent to handle a task inline. The sub-agent runs
independently with its own tool set and returns a text result.Features:
- Runs inline — result returned directly to the parent agent
- Optional tool allowlist to restrict sub-agent capabilities
- Custom system prompt and max tokens per sub-agent
- Depth-limited nesting (max 3 levels)
- 5-minute timeout, 30k char output truncation
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 | All | Approved tools execute in parallel |
| Delegate timeout | 5 minutes | Max execution time for sub-agents |
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.
Next Steps
Skills
Compose tools into capability bundles
Custom Tools Guide
Build your own tools

