Prompt an OpenCode session
opencode_session_promptSend a prompt to an OpenCode session and return assistant text, tool calls, and usage. Attach files or set wait=false for fire-and-forget runs.
Instructions
Send a message to a session and (by default) wait for the answer. Returns the assistant text, new turns, tool calls and usage. Attach files with files (path or data: URI). Set wait=false for fire-and-forget.
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>",
"text": "<text>"
},
"name": "opencode_session_prompt"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | The prompt text | |
| wait | No | Wait for the run to finish (default true) | |
| files | No | ||
| agents | No | Agents the model may delegate to | |
| skills | No | ||
| sessionID | Yes | ||
| timeoutMs | No | Default 45000 (kept under typical MCP client timeouts) |