ssh_shell_wait
Hold execution until shell output contains a specified pattern or becomes stable, then return the output. Useful for synchronizing with long-running remote commands.
Instructions
Wait for the shell output to contain a specific pattern, or for the output to stabilize (no new output for two poll intervals). Useful for waiting on long-running commands to complete.
Args: session_id: The session ID returned by ssh_connect. pattern: Text pattern to wait for (e.g. a shell prompt like "$ " or "# "). If empty, waits for output to stabilize. timeout: Maximum seconds to wait (default: 300). poll_interval: Seconds between polls (default: 2.0). lines: Number of tail lines to return (default: 100).
Returns: Shell output when the pattern is found or output stabilizes.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| session_id | Yes | ||
| pattern | No | ||
| timeout | No | ||
| poll_interval | No | ||
| lines | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |