Delegate a task to OpenCode
opencode_taskOne-shot delegation: create a session, send a prompt, wait for the run, and return ONLY the final summary. Tool calls, intermediate steps and reasoning stay inside OpenCode, so the caller's context stays clean.
Instructions
One-shot delegation: create a session, send a prompt, wait for the run, and return ONLY the final summary. Tool calls, intermediate steps and reasoning stay inside OpenCode, so the caller's context stays clean. Use background=true to get an immediate 'working' acknowledgement and collect the summary later with opencode_job. Set verbosity='full' only when a transcript is explicitly needed.
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 | Wait for the run (default true; ignored when background=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 inline, 1800000 in background | |
| verbosity | No | summary (default). 'full' is admin-only and usually disabled | |
| background | No | Return immediately with a jobID instead of waiting | |
| parentSessionID | No | Attach the task as a subagent of this session |