Skip to main content
Glama
ssh-sftp-mcp

ssh-sftp-mcp

by endjoker

Poll a long-running task

ssh_task_poll
Read-onlyIdempotent

Poll a background SSH command's task state and read new stdout/stderr increments from byte offsets without blocking; pass prior nextOffset values to continue streaming output.

Instructions

Returns task state and reads stdout/stderr increments from independent byte offsets. Returns running immediately when there is no new output; it never blocks. Pass stdoutAfterOffset / stderrAfterOffset and use the returned nextOffset of each stream; gaps from buffer recycling are reported in the droppedBeforeOffset of that stream.

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": {
      "taskId": "<taskId>"
    },
    "name": "ssh_task_poll"
  }
}

Input Schema

NameRequiredDescriptionDefault
taskIdYes
maxBytesNoMaximum bytes returned per stream in this call
outputFormatNotext puts content in text, structured puts it in structuredContent, both keeps the legacy shapetext
stderrAfterOffsetNostderr nextOffset from the previous poll; use 0 on the first call
stdoutAfterOffsetNostdout nextOffset from the previous poll; use 0 on the first call

Output Schema

NameRequiredDescriptionDefault
noteNo
stateYes
bufferYes
signalYes
stderrYes
stdoutYes
taskIdYes
endedAtYes
exitCodeYes
startedAtYes
updatedAtYes
connectionIdYes
cancelRequestedYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.9/5.0
Behavior4/5

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

Annotations already cover the safety profile (readOnly, idempotent, non-destructive, closed-world), and the description adds real operational context on top: non-blocking, returns running immediately when there is no new output, and buffer recycling can lose data with the gap surfaced in droppedBeforeOffset. That last point is a data-loss caveat an agent would otherwise not anticipate.

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

Conciseness4/5

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

Three dense sentences, front-loaded with what the tool returns before explaining the offset mechanics. No filler, though the phrasing is compressed enough that the droppedBeforeOffset clause reads as a fragment.

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?

An output schema exists, so return shape need not be described. Given that, the definition covers everything an agent needs to drive a polling loop correctly: non-blocking behavior, the offset continuation contract, per-stream increment limits via maxBytes, and the risk of buffer gaps.

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

Parameters4/5

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

Schema coverage is 80%, so the baseline is 3. The description exceeds it by explaining the round-trip contract: pass stdoutAfterOffset/stderrAfterOffset and feed back the returned nextOffset of each stream. The schema documents each field in isolation but does not make the cross-call continuation relationship explicit.

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

Purpose4/5

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

States a specific verb and resource: returns task state and reads incremental stdout/stderr from independent byte offsets. The incremental-poll purpose is unmistakable and clearly distinct from initiating work (ssh_exec_start) or cancellation (ssh_task_cancel), though it never names those siblings to draw the boundary explicitly.

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

Usage Guidelines3/5

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

Usage is implied rather than stated: the offset/nextOffset loop tells an experienced agent how to call it repeatedly, and 'never blocks' tells it this is safe to call in a spin. But there is no explicit when-to-use guidance (e.g. call after ssh_exec_start, or that cancel is a separate tool) and no stated conditions for when not to poll.

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