Agents and subagents
opencode_agentList available primary and subagent agents, switch a session's agent, or delegate a one-shot task to a subagent; delegation returns the child session transcript.
Instructions
List available agents (primary and subagent), switch the agent of a session, or delegate a one-shot task to a subagent. Delegation creates a real child session and returns its transcript.
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": {
"action": "<action>"
},
"name": "opencode_agent"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| agent | No | Agent id, e.g. general, explore, build | |
| action | Yes | ||
| prompt | No | For action=delegate | |
| directory | No | ||
| sessionID | No | For action=set | |
| timeoutMs | No | ||
| parentSessionID | No |