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.
{% tabs %} {% tab label="VSCode" %}
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, codesearch | 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 (experimental) | 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 web (available to Kilo/OpenRouter users)codesearch - Semantic code search (available to Kilo/OpenRouter users)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 when the experimental Agent Manager Tool setting is enabled in VS Code{% /tab %} {% tab label="VSCode (Legacy)" %}
Tools are organized into logical groups based on their functionality:
| Category | Purpose | Tools | Common Use |
|---|---|---|---|
| Read Group | File system reading and searching | read_file, search_files, list_files, list_code_definition_names | Code exploration and analysis |
| Edit Group | File system modifications | apply_diff, delete_file, write_to_file | Code changes and file manipulation |
| Browser Group | Web automation | browser_action | Web testing and interaction |
| Command Group | System command execution | execute_command | Running scripts, building projects |
| MCP Group | External tool integration | use_mcp_tool, access_mcp_resource | Specialized functionality through external servers |
| Workflow Group | Mode and task management | switch_mode, new_task, ask_followup_question, attempt_completion, update_todo_list | Context switching and task organization |
Certain tools are accessible regardless of the current mode:
These tools help Kilo Code understand your code and project:
These tools help Kilo Code make changes to your code:
These tools help Kilo Code interact with web applications:
These tools help Kilo Code execute commands:
These tools help Kilo Code connect with external services:
These tools help manage the conversation and task flow:
{% /tab %} {% /tabs %}
Tools 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
[ask_followup_question](/docs/automate/tools/ask-followup-question) → [read_file](/docs/automate/tools/read-file) → [search_files](/docs/automate/tools/search-files)
Code Modification
[read_file](/docs/automate/tools/read-file) → [apply_diff](/docs/automate/tools/apply-diff) → [attempt_completion](/docs/automate/tools/attempt-completion)
Task Management
[new_task](/docs/automate/tools/new-task) → [switch_mode](/docs/automate/tools/switch-mode) → [execute_command](/docs/automate/tools/execute-command)
Progress Tracking
[update_todo_list](/docs/automate/tools/update-todo-list) → [execute_command](/docs/automate/tools/execute-command) → [update_todo_list](/docs/automate/tools/update-todo-list)
Tool-Specific Errors
System Errors
Context Errors
Automatic Recovery
User Intervention