session_create
Creates an OpenCode session in a specified working directory on a chosen server, with optional model, agent, title, and gated write access; omit the server when only one is available.
Instructions
Create a session on one server. Omit the server argument when exactly one server is available.
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": {
"directory": "<directory>"
},
"name": "session_create"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| agent | No | Agent name to use. | |
| model | No | ||
| title | No | Session title. | |
| server | No | Server id. Omit when exactly one server is available. | |
| allowed | No | Allow write operations (gated). | |
| directory | Yes | Working directory for the session. |