Skip to main content
Glama
cygnussystems

cygnus-ssh-mcp

Official

ssh_cmd_check_status

Wait a set duration, then check the status of a command started by ssh_cmd_run. Poll repeatedly until it returns a terminal state like completed or killed.

Instructions

Wait for the specified duration, then check the status of a command started with ssh_cmd_run. Call this repeatedly - it's designed to be polled - after ssh_cmd_run returns status='io_timeout' or 'wait_timeout' (the remote command is still genuinely running in both cases - background monitoring keeps collecting its output/exit code), until you get a TERMINAL status below. Do not rerun the original command while polling.

Terminal status values (nothing left to wait for, stop polling):

  • 'completed': confirmed finished, exit_code is populated - including for commands that survived an io_timeout/wait_timeout, since background monitoring keeps watching for the real exit code.

  • 'killed': the remote process was confirmed terminated (e.g. runtime_timeout killed it, or a prior ssh_cmd_kill call found it already gone) - exit_code is not known.

  • 'completed_exit_code_unknown': rare fallback - monitoring stopped without a confirmed exit code (should only really happen from before background monitoring existed, or after an unexpected error) and a live check now confirms the remote process is no longer running. Only its output (via ssh_cmd_output) is available, not its exit code.

Non-terminal status values (keep polling):

  • 'running': still being actively monitored, not yet finished.

  • 'unknown_still_running': rare fallback (same caveat as 'completed_exit_code_unknown') where a live check confirms the remote command is still actually running. Not a failure - call this tool again to keep checking.

Other:

  • 'not_found': the handle_id doesn't exist (may be from a previous connection - handles don't survive reconnects, but background task PIDs from ssh_task_launch do).

  • 'unknown': the handle exists but its metadata is missing from history (rare, internal inconsistency) - treat like 'not_found'.

Fallback behavior: if handle_id doesn't match any ssh_cmd_run handle, this tool also tries treating it as a raw background-task PID (same as ssh_task_status) and, if that succeeds, returns {'pid', 'status': 'running'/'exited'/'invalid'/'error', 'is_background_task': True, ...} instead - a DIFFERENT status vocabulary than the one above. Prefer ssh_task_status directly for PIDs to avoid ambiguity.

Returns: {'handle_id', 'waited_seconds', 'status', 'exit_code', 'pid', 'output_available', 'output_lines', 'timestamp'}, plus 'next_step' (guidance text) when status is non-terminal.

For an OPERATION handle (the handle_id of an 'in_progress' response from a
long-running tool such as ssh_archive_extract or ssh_file_transfer): returns
`{'handle_id', 'status', 'tool', 'operation', 'started', 'ended', ...}` with status
'running', 'completed' (plus 'result': the tool's full normal result) or 'failed'
(plus 'error'). The wait ends early as soon as the operation finishes. While
running it also returns 'elapsed_seconds' and 'progress': the current 'stage'
(e.g. 'uploading archive', 'extracting on host'), 'bytes_done'/'bytes_total'/
'percent' for transfers, counts such as 'files_searched', and 'last_update' /
'seconds_since_update' - if those stop advancing for a long time, the operation
may be stuck rather than just slow.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
handle_idYesCommand handle ID to check status for - the 'id' returned by ssh_cmd_run, including in its io_timeout/wait_timeout response
wait_secondsNoSeconds to wait before checking. Clamped to the server's per-call wait cap (default 50s, since most MCP clients abort tool calls at ~60s) - the response's waited_seconds shows the wait actually applied. Short waits (1-10s) with repeated polling work best.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv1.6.1
    • changedInput schema / properties / handle_id / description
      Previous value: -"Command handle ID to check status for"New value: +"Command handle ID to check status for - the 'id' returned by ssh_cmd_run, including in its io_timeout/wait_timeout response"
    • changedInput schema / properties / wait_seconds / description
      Previous value: -"Seconds to wait before checking"New value: +"Seconds to wait before checking. Clamped to the server's per-call wait cap (default 50s, since most MCP clients abort tool calls at ~60s) - the response's waited_seconds shows the wait actually applied. Short waits (1-10s) with repeated polling work best."
  2. First observedv1.3.0

TDQS

A4.5/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden and does so: background monitoring keeps collecting output/exit codes after a timeout, handles do not survive reconnects while ssh_task_launch PIDs do, the PID fallback returns a different status vocabulary, and the wait cap exists because MCP clients abort at ~60s. These are non-obvious behavioral traits an agent could not infer elsewhere.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Purpose and polling rules are well front-loaded with clear terminal/non-terminal grouping, but the long 'Returns:' block largely duplicates the existing output schema, and the OPERATION-handle paragraph is verbose. Much earns its place; a meaningful portion does not.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a high-complexity polling tool, the description enumerates every terminal and non-terminal status, explains the rare fallbacks, the not_found/unknown distinction, and the operation-handle variant. An agent has everything needed to poll correctly and interpret each result.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents both handle_id and wait_seconds (including the clamp and polling advice). The description restates handle_id's origin but adds no syntax, format, or edge-case detail beyond what the schema provides, so baseline 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The opening sentence states a specific verb+resource ('check the status of a command started with ssh_cmd_run') and immediately scopes it as a polling companion to ssh_cmd_run. It is clearly distinguishable from ssh_task_status, ssh_cmd_output and ssh_cmd_kill without opening any schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicit when-to-use ('after ssh_cmd_run returns status=io_timeout or wait_timeout'), how-often ('call this repeatedly - it's designed to be polled'), what not to do ('Do not rerun the original command while polling'), and an alternative routing rule ('Prefer ssh_task_status directly for PIDs to avoid ambiguity'). All conditions that select this tool versus siblings are stated.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.