

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 4
click for more info
Not enough gems
Cost: 6 gems
1: Tools
incomplete
2: Built-in Tools
incomplete
3: Specialized Tools
incomplete
4: Custom Tools
incomplete
5: Create a Custom Tool
incomplete
6: Tool Permissions
incomplete
7: Sandboxing
incomplete
Back
ctrl+,
Next
ctrl+.
This lesson's interactive features are locked, please to keep using them
Tools are how an agent does stuff, rather than just talking about stuff.
Without tools, an LLM can only respond with text in a chat window. Sure, it can suggest that you run a command, describe a refactor, or explain how to debug something, but it can't actually do it for you.
With tools, it can.
A tool is essentially a function the model is allowed to call. For example, OpenCode comes with a read tool that lets the model read files.
The agent harness tells the model which tools are available, what each one does, and what arguments each accepts.
Say the model wants to read a file. It can do so by generating a tool call – a structured request naming the tool and supplying its arguments, kinda like this:
{
"tool": "read",
"args": {
"path": "internal/api/handlers.go"
}
}
OpenCode parses that request, calls the tool, and adds the contents of the file that it read back into the model's context. The model can then use that information to respond to you or choose another tool call.