read_output
Retrieve pending output from a background Kali task by session ID. Waits up to the timeout, then returns available lines—useful for polling long-running commands.
Instructions
Read or poll bounded output from a background command job.
Typical workflow:
send_input(session_id, "whoami\n")
read_output(session_id, timeout=5) -> returns the command's output
The backend will wait up to timeout seconds for new output before
returning whatever is available (which may be empty if the process has
not produced anything yet).
Args: session_id: The session identifier to read from. timeout: Maximum seconds the backend should wait for new output before returning (default: 5). Use a higher value for slow commands (e.g. nmap, compilation). lines: Maximum number of output lines to return (default: 100). Older lines are trimmed first when the buffer exceeds this.
Returns: dict with at minimum: - success (bool): whether the read succeeded - output (str): the collected output text - session_id (str): echo of the session targeted - lines_returned (int): number of lines in output - error (str, optional): present only on failure
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| lines | No | ||
| timeout | No | ||
| session_id | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |