Skip to main content

Overview

Custom tools are functions the LLM can call during conversations. They extend what AI agents can do beyond built-in capabilities.

Tool Locations

Basic Tool Structure

The filename becomes the tool name.

Multiple Tools Per File

Creates tools: 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