continue-custom/docs/features/agent/how-it-works.mdx
Brian 'bdougie' Douglas 6447315f57 snake case
2025-07-19 13:51:59 -07:00

53 lines
2.3 KiB
Text

---
title: "How Agent Works"
description: "Agent offers the same functionality as Chat, while also including tools in the request to the model and an interface for handling tool calls and responses."
---
## The tool handshake
Tools provide a flexible, powerful way for models to interface with the external world. They are provided to the model as a JSON object with a name and an arguments schema. For example, a `read_file` tool with a `filepath` argument will give the model the ability to request the contents of a specific file.
The following handshake describes how Agent uses tools:
1. In Agent mode, available tools are sent along with `user` chat requests
2. The model can choose to include a tool call in its response
3. The user gives permission. This step is skipped if the policy for that tool is set to `Automatic`
4. Continue calls the tool using built-in functionality or the MCP server that offers that particular tool
5. Continue sends the result back to the model
6. The model responds, potentially with another tool call and step 2 begins again
<Info>
Tool availability varies by mode:
- **Chat mode**: No tools included
- **Plan mode**: Only read-only tools included
- **Agent mode**: All tools included
</Info>
## Built-in tools
Continue includes several built-in tools which provide the model access to IDE functionality.
### Plan mode tools (read-only)
In Plan mode, only these read-only tools are available:
- **Read file** (`read_file`)
- **Read currently open file** (`read_currently_open_file`)
- **List directory** (`ls`)
- **Glob search** (`glob_search`)
- **Grep search** (`grep_search`)
- **Fetch URL content** (`fetch_url_content`)
- **Search web** (`search_web`)
- **View diff** (`view_diff`)
- **View repo map** (`view_repo_map`)
- **View subdirectory** (`view_subdirectory`)
- **Codebase tool** (`codebase_tool`)
### Agent mode tools (all tools)
In Agent mode, all tools are available including the read-only tools above plus:
- **Create new file** (`create_new_file`): Create a new file within the project
- **Edit file** (`edit_file`): Make changes to existing files
- **Run terminal command** (`run_terminal_command`): Run commands from the workspace root
- **Create Rule Block** (`create_rule_block`): Create a new rule block in `.continue/rules`
- All other write/execute tools for modifying the codebase