Skip to content

Commit b1550bd

Browse files
committed
Add docs for tool usage
1 parent 48a0d52 commit b1550bd

File tree

2 files changed

+70
-0
lines changed

2 files changed

+70
-0
lines changed

docs/basic-usage/using-tools.md

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# Using Tools
2+
3+
Roo Code has a set of built-in tools that it can use to interact with your code, files, and environment. These tools allow Roo Code to perform actions like:
4+
5+
* Reading and writing files
6+
* Executing commands in the terminal
7+
* Searching your codebase
8+
* Accessing information from the web (with browser support enabled)
9+
10+
You don't need to *tell* Roo Code which tool to use. Just describe your task in plain English, and Roo Code will determine the appropriate tool (or sequence of tools) to use. You will always have the opportunity to approve or reject each tool use.
11+
12+
## Available Tools
13+
14+
Here's a brief overview of the core tools available in Roo Code:
15+
16+
| Tool | Description |
17+
| :---------------------------| :----------------------------------------------------------------------------|
18+
| `read_file` | Reads the content of a file. |
19+
| `write_to_file` | Creates a new file or overwrites an existing file with the provided content. |
20+
| `apply_diff` | Applies a set of changes (a "diff") to an existing file. |
21+
| `execute_command` | Runs a command in the VS Code terminal. |
22+
| `search_files` | Searches for text or a regular expression within files in a directory. |
23+
| `list_files` | Lists the files and directories within a given directory. |
24+
| `list_code_definition_names`| Lists code definitions like class names. |
25+
| `browser_action` | Performs actions in a headless browser (if enabled). |
26+
| `ask_followup_question` | Asks you a clarifying question. |
27+
| `attempt_completion` | Indicates that Roo Code believes the task is complete. |
28+
29+
**Note:** The availability of some tools may depend on the current [mode](./modes.md) and your settings.
30+
31+
## How Tools are Used
32+
33+
1. **You describe your task:** You tell Roo Code what you want to achieve in the chat input.
34+
2. **Roo Code proposes a tool:** Roo Code analyzes your request and determines which tool (or sequence of tools) is most appropriate.
35+
3. **You review and approve:** Roo Code presents the proposed tool use, including the tool name and any parameters (like the file path or command to execute). You can review this proposal and either **Approve** or **Reject** it.
36+
4. **Roo Code executes the tool (if approved):** If you approve, Roo Code executes the tool and shows you the result.
37+
5. **Iteration:** Roo Code may use multiple tools in sequence to complete a task, waiting for your approval after each step.
38+
39+
## Example
40+
41+
Let's say you want to create a new file named `hello.txt` with the content "Hello, world!". The interaction might look like this:
42+
43+
**You:** Create a file named `hello.txt` with the content "Hello, world!".
44+
45+
**Roo Code:** (Proposes to use the `write_to_file` tool)
46+
47+
```xml
48+
<write_to_file>
49+
<path>hello.txt</path>
50+
<content>
51+
Hello, world!
52+
</content>
53+
</write_to_file>
54+
```
55+
56+
**You:** (Click "Approve")
57+
58+
**Roo Code:** (Confirms that the file was created)
59+
60+
## Important Considerations
61+
62+
* Always review proposed actions carefully. Even though Roo Code is designed to be helpful, it's still an AI, and it can make mistakes.
63+
* Start with small tasks. Get comfortable with Roo Code's behavior before giving it more complex instructions.
64+
* Use context mentions. Provide clear context using @ mentions (e.g., @/src/file.ts) to help Roo Code understand your request.
65+
* Use custom instructions. Guide Roo's behavior even more with custom instructions, or change the prompt using different modes
66+
67+
## Advanced Tool Usage
68+
69+
Roo Code can be extended with additional tools using the Model Context Protocol (MCP). See the [MCP](../advanced-usage/mcp) section for more details. You can also create [Custom Modes](../advanced-usage/custom-modes) with restricted tool access for enhanced safety and control.

sidebars.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ const sidebars: SidebarsConfig = {
1818
items: [
1919
'basic-usage/the-chat-interface',
2020
'basic-usage/typing-your-requests',
21+
'basic-usage/using-tools',
2122
'basic-usage/context-mentions',
2223
'basic-usage/modes',
2324
],

0 commit comments

Comments
 (0)