terminal_run
Type a command into an interactive shell session and wait until it finishes, returning the resulting screen in one call. Block on the prompt, a regex match, or output silence.
Instructions
Type a command, wait for it to finish, and return the resulting screen in one call.
By default it waits until the shell is back at its prompt. Provide until to wait for a
regex instead, or quiet_ms to wait for output to go quiet.
Args: session_id: Session returned by terminal_start. text: Literal command to type. keys: Named keys to send instead of text (see terminal_send). enter: Append Enter after text/keys (default true). until: Case-insensitive regex to wait for instead of the prompt. quiet_ms: Wait for this long without output instead of the prompt. timeout_ms: Give up after this long. max_chars: Maximum characters returned in the screen. history: Number of scrollback lines to prepend to the screen.
Returns: reason ("prompt" | "matched" | "quiet" | "exited" | "timeout"), matched, sent_chars, screen, cursor, running and exit_code.
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": "terminal_run"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| keys | No | ||
| text | No | ||
| enter | No | ||
| until | No | ||
| history | No | ||
| quiet_ms | No | ||
| max_chars | No | ||
| session_id | Yes | ||
| timeout_ms | No |