| 1 | --- |
| 2 | title: "How Agent Works" |
| 3 | 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." |
| 4 | --- |
| 5 | |
| 6 | ## The tool handshake |
| 7 | |
| 8 | 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. |
| 9 | |
| 10 | The following handshake describes how Agent uses tools: |
| 11 | |
| 12 | 1. In Agent mode, available tools are sent along with `user` chat requests |
| 13 | 2. The model can choose to include a tool call in its response |
| 14 | 3. The user gives permission. This step is skipped if the policy for that tool is set to `Automatic` |
| 15 | 4. Continue calls the tool using built-in functionality or the MCP server that offers that particular tool |
| 16 | 5. Continue sends the result back to the model |
| 17 | 6. The model responds, potentially with another tool call and step 2 begins again |
| 18 | |
| 19 | <Info> |
| 20 | In [Chat mode](/features/chat/quick-start), tools are **not** included in the |
| 21 | request to the model. |
| 22 | </Info> |
| 23 | |
| 24 | ## Built-in tools |
| 25 | |
| 26 | Continue includes several built-in tools which provide the model access to IDE functionality: |
| 27 | |
| 28 | - **Read file** (`read_file`): read the contents of a file within the project |
| 29 | - **Read currently open file** (`read_currently_open_file`): read the contents of the currently open file |
| 30 | - **Create new file** (`create_new_file`): Create a new file within the project, with path and contents specified by the model |
| 31 | - **Exact search** (`exact_search`): perform a `ripgrep` search within the project |
| 32 | - **Glob search** (`file_glob_search`): perform a glob search on files in the project. Currently limits to 100 output and warns the Agent if limit reached. |
| 33 | - **Run terminal command** (`run_terminal_command`): run a terminal command from the workspace root |
| 34 | - **Search web** (`search_web`): Perform a web search to get top results |
| 35 | - **View diff** (`view_diff`): View the current working git diff |
| 36 | - **View repo map** (`view_repo_map`): request a copy of the repository map—same as the [Repo Map Context Provider](/customize/custom-providers#repository-map) |
| 37 | - **View subdirectory** (`view_subdirectory`): request a copy of a repo map for a specific directory within the project |
| 38 | - **Create Rule Block** (`create_rule_block`): creates a new rule block in `.continue/rules` based on the contents of the conversation |