Skip to main content
Glama
ssh-sftp-mcp

ssh-sftp-mcp

by endjoker

Cancel a long-running task

ssh_task_cancel
DestructiveIdempotent

Request closing the SSH exec channel for a background task and report whether the close or remote exit status was acknowledged, not remote command termination.

Instructions

Requests closing the SSH exec channel owned by this task. channelCloseConfirmed reports whether a channel close or a remote exit status was observed; that only means the request was acknowledged by the server or remote side, and does not prove the remote command or its children have terminated.

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_cancel"
  }
}

Input Schema

NameRequiredDescriptionDefault
taskIdYes

Output Schema

NameRequiredDescriptionDefault
noteNo
stateYes
signalYes
taskIdYes
endedAtYes
exitCodeYes
startedAtYes
updatedAtYes
connectionIdYes
cancelRequestedYes
channelCloseConfirmedYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true and idempotentHint=true, but the description adds real value beyond them: it explains that cancellation is a channel-close request and that a successful channelCloseConfirmed does not prove the remote command or its children actually terminated. This is exactly the kind of limitation an agent needs. It stops short of covering side effects on subsequent polls or whether the task record is removed.

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

Conciseness5/5

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

Two sentences, zero filler, with the operational constraint front-loaded in sentence one and the caveat immediately after. The field name channelCloseConfirmed is used without labeling it as a return field, but the output schema supplies that context.

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

Completeness4/5

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

For a single-parameter mutation tool with annotations and an output schema, the description covers the essential nuance (best-effort cancellation, ambiguous confirmation). The remaining gap is procedural — whether to poll afterward and what happens if the channel is already gone — which is minor against the existing structured data.

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 0% for the single taskId parameter, so the description must carry the load. It partially does by tying the channel to the owning task, but it never states what taskId format is expected or where an agent obtains it (presumably an ssh_exec_start response).

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?

The description gives a specific verb and resource: 'Requests closing the SSH exec channel owned by this task.' That is precise enough to separate it from ssh_task_poll (observation) and sftp_transfer_cancel (non-SSH transfers), though it never names those siblings 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 by the title and first sentence: use when a long-running SSH task should stop. But there is no explicit guidance on when to cancel versus polling with ssh_task_poll, no prerequisite/state conditions (does the task need to be running?), and no statement about what to do after cancel returns.

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