packages/kilo-docs/pages/automate/tools/index.md
Kilo Code implements a sophisticated tool system that allows AI models to interact with your development environment in a controlled and secure manner. This document explains how tools work, when they're called, and how they're managed.
Tools are organized into logical groups based on their functionality:
| Category | Purpose | Tools | Common Use |
|---|---|---|---|
| Read Group | File system reading and searching | read, glob, grep | Code exploration and analysis |
| Edit Group | File system modifications | edit, write, apply_patch | Code changes and file manipulation |
| Execute Group | Shell command execution | bash | Running scripts, building projects |
| Web Group | Fetch and search web content | webfetch, websearch | Research, documentation lookup |
| Browser Group | Web browser automation | kilo-playwright_* (via built-in Playwright MCP) | Browser testing and interaction |
| MCP Group | External tool integration | MCP server tools (namespaced as {server}_{tool}) | Specialized functionality via MCP |
| Workflow Group | Sub-agents and task management | question, task, todowrite, todoread, plan, skill, agent_manager | Context switching and task organization |
Certain tools are accessible regardless of the current agent:
question: Ask the user a clarifying question with selectable optionstask: Spawn a sub-agent sessiontodowrite / todoread: Manage session task listsThese tools help Kilo Code understand your code and project:
read - Reads file contents with line numbersglob - Finds files matching a glob patterngrep - Searches file contents with regexThese tools help Kilo Code make changes to your code:
edit - Makes precise text replacements in a filewrite - Creates new files or fully overwrites existing onesapply_patch - Applies unified diffs (used with certain models)For multiple replacements in one file, Kilo uses repeated edit calls or a patch-style edit when the model supports it.
These tools help Kilo Code run commands:
bash - Runs shell commands with configurable timeout and working directoryThese tools help Kilo Code access web content:
webfetch - Fetches a URL and returns the contentwebsearch - Searches the webwebsearch is available automatically with the Kilo provider. For models from other providers it is off by default; enable it for all providers by setting web_search in kilo.jsonc:
{
"web_search": true
}
In the VS Code extension, the same option lives under Settings → Web Tools → Web Search → Enable for All Providers. The KILO_ENABLE_EXA and KILO_ENABLE_PARALLEL environment flags also enable it.
websearch routes through the Exa or Parallel search providers. When the Exa provider is used and you are signed into Kilo, requests go through the Kilo proxy automatically — no separate Exa API key is required. Setting EXA_API_KEY uses your own Exa key instead. Exa searches return at most 10 results.
Set the KILO_WEBSEARCH_PROVIDER environment variable to force a provider:
| Value | Behavior |
|---|---|
exa | Use Exa — through the Kilo proxy when signed in, through EXA_API_KEY when set |
parallel | Use Parallel |
kilo-exa | Always route Exa searches through the Kilo proxy (requires Kilo sign-in) |
The VS Code extension has a built-in browser automation tool powered by Playwright MCP. Enable it in Settings → Browser Automation. When enabled, it registers an MCP server named kilo-playwright and exposes tools such as:
kilo-playwright_browser_navigate - Navigate to a URLkilo-playwright_browser_click - Click an elementkilo-playwright_browser_type - Type text into an elementkilo-playwright_browser_screenshot - Capture a screenshotkilo-playwright_browser_snapshot - Capture an accessibility snapshotThese follow the same permission model as all MCP tools (see below).
MCP server tools are automatically available when an MCP server is connected. Tool names are namespaced as {server}_{tool}. See MCP Overview for details.
These tools help manage the conversation and task flow:
question - Asks you a clarifying question with selectable optionstask - Spawns a sub-agent (child session)todowrite - Creates and updates a session TODO listtodoread - Reads the current session TODO listplan - Enters structured planning modeskill - Invokes a reusable skill (Markdown instruction module)agent_manager - Starts Agent Manager local or worktree sessions in VS CodeTools are invoked under specific conditions:
Direct Task Requirements
Mode-Based Availability
Context-Dependent Calls
The system uses a multi-step process to determine tool availability:
Mode Validation
isToolAllowedForMode(
tool: string,
modeSlug: string,
customModes: ModeConfig[],
toolRequirements?: Record<string, boolean>,
toolParams?: Record<string, any>
)
Requirement Checking
Parameter Validation
Initialization
Execution
const toolCall = {
type: "tool_call",
name: chunk.name,
arguments: chunk.input,
callId: chunk.callId,
}
Result Handling
Access Control
Validation Layers
Tools are made available based on the current mode:
Process
Impact on Tools
Efficiency
Security
Error Handling
Information Gathering
`question` → `read` → `grep`
Code Modification
`read` → `edit` → final response
Task Management
`task` → `bash` → final response
Progress Tracking
`todowrite` → `bash` → `todowrite`
Tool-Specific Errors
System Errors
Context Errors
Automatic Recovery
User Intervention