Delegate a task to OpenCode
opencode_taskDelegate a one-shot coding task to a subagent in a workspace, send a prompt, wait for completion, and return the answer with the transcript. Use for repo-specific requests needing a single run.
Instructions
One-shot delegation: create a session in a workspace, send a prompt, wait for the result, and return the answer plus the subagent transcript. Use this for 'have OpenCode do X in this repo' requests; use opencode_session_* when you need a persistent conversation.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"prompt": "<prompt>"
},
"name": "opencode_task"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| wait | No | Default true | |
| agent | No | Agent id (default general; try explore for read-only research) | |
| model | No | ||
| title | No | ||
| prompt | Yes | What the agent should do | |
| directory | No | Absolute workspace; defaults to the client's directory | |
| timeoutMs | No | Default 45000 | |
| parentSessionID | No | Attach the task as a subagent of this session |