session_interact
Send input and read output in one call to cut round trips, with optional wait for a regex pattern in the output.
Instructions
Send input and read output in a single call. Combines session_send + session_read to halve round trips. Optionally waits for a regex pattern in the output.
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": {
"session_id": "<session_id>"
},
"name": "session_interact"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| key | No | Special key | |
| input | No | Text to send | |
| timeout | No | Seconds to wait for output | |
| password | No | Secret input (not logged) | |
| wait_for | No | Regex pattern to wait for in output | |
| confirmed | No | Set to true to bypass dangerous command gate | |
| read_mode | No | Read mode for output: 'stream' (default), 'snapshot', 'auto', 'diff' | |
| session_id | Yes | Session ID | |
| strip_ansi | No | Strip ANSI sequences | |
| truncation | No | Truncation mode for output | |
| press_enter | No | Append carriage return | |
| control_char | No | Control character |