opencode_ask
Ask OpenCode a coding question in one step: creates a session, sends your prompt, and returns the AI response. Get direct answers without managing sessions.
Instructions
Ask OpenCode a question in one step. Creates a new session, sends your prompt, and returns the AI response. This is the easiest way to interact with OpenCode.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| agent | No | Agent to use (e.g. 'build', 'plan') | |
| title | No | Optional title for the session | |
| format | No | Response format: plain text or JSON constrained by a JSON Schema. JSON Schema requires OpenCode permission for the StructuredOutput tool. | |
| prompt | Yes | The question or instruction to send | |
| system | No | Optional system prompt override | |
| modelID | No | Model ID (e.g. 'claude-3-5-sonnet-20241022') | |
| 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. | |
| providerID | No | Provider ID (e.g. 'anthropic') |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | No | ||
| text | Yes | ||
| isError | Yes |