opencode_command_execute
Execute slash commands like /init or /undo within a target OpenCode session to trigger workflows and manage session state.
Instructions
Execute a slash command in a session (e.g. /init, /undo).
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": {
"sessionId": "<sessionId>",
"command": "<command>"
},
"name": "opencode_command_execute"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| agent | No | ||
| command | Yes | ||
| modelID | No | ||
| variant | No | ||
| arguments | No | ||
| directory | No | Project directory to target. Optional; defaults to the server default project. | |
| sessionId | Yes | ||
| providerID | No |