opencode_message_send
Send a prompt to an AI session and wait for the response. Specify model, agent, or format to get structured output for coding tasks.
Instructions
Send a prompt message to a session and wait for the AI response. Use parts to send text, and optionally specify a model.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | The text message to send | |
| agent | No | Agent to use | |
| format | No | Response format: plain text or JSON constrained by a JSON Schema. JSON Schema requires OpenCode permission for the StructuredOutput tool. | |
| system | No | System prompt override | |
| modelID | No | Model ID (e.g. 'claude-3-5-sonnet-20241022') | |
| noReply | No | If true, inject context without triggering AI response (useful for plugins) | |
| variant | No | Model variant (e.g. 'fast', 'smart') | |
| directory | No | Absolute path to the project directory. When provided, the request targets that project. If omitted, the OpenCode server uses its own working directory. | |
| sessionId | Yes | Session ID | |
| providerID | No | Provider ID (e.g. 'anthropic') |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | No | ||
| text | Yes | ||
| isError | Yes |