OpenCode Tool icon

OpenCode Tool

Use OpenCode AI coding assistant as a tool for AI agents

OpenCode Tool

AI-generated

Summary

Configure an OpenCode AI tool instance for AI agents

Inputs

None.

Output shape

ai_tool

Returns a DynamicStructuredTool instance configured with the provided parameters. The tool accepts a 'message' string and returns the AI's response text.

Examples

Example 1: Use existing session with specified model

sessionMode=existing, sessionId=, model=provider::model, toolName=opencode

Example 2: Use temporary session for single request

sessionMode=temporary, tempSessionTitle=Debug Session, model=provider::model

Links

Discussion