Overview
Custom tools are functions the LLM can call during conversations. They extend what AI agents can do beyond built-in capabilities.Tool Locations
| Location | Scope |
|---|---|
.opencode/tool/ | Project |
~/.config/opencode/tool/ | Global |
Basic Tool Structure
Multiple Tools Per File
math_add and math_multiply (filename prefix + export name).
Tool Context
Access session and agent information:Using External Languages
Wrap non-TypeScript tools with a TypeScript shell:.opencode/tool/add.py
.opencode/tool/python-add.ts
See Also
- Plugin Development — Create tools inside plugins.
- MCP Servers — External tool providers via MCP.
- Permissions — Control tool access per agent.