Skip to main content
Glama
SSH MCP Server

SSH MCP Server

by YawLabs

ssh_delete

Destructive

Deletes a remote file or empty directory over SFTP, automatically detecting the path type and using unlink or rmdir; recursive removal is not supported.

Instructions

Delete a file or empty directory on a remote host via SFTP. Auto-detects the path type and calls the right SFTP op (unlink for files/symlinks, rmdir for empty dirs). Recursive directory delete is intentionally NOT supported -- for that, use ssh_exec with rm -rf explicitly so the destructive intent is visible in the tool trace. If the connection pool is full (SSH_MCP_MAX_POOL_SIZE, default 100), waits up to 30s for a free slot before starting. NOT gated by SSH_MCP_COMMAND_WHITELIST / SSH_MCP_COMMAND_BLACKLIST: command policy applies only to ssh_exec and ssh_multi_exec, so a blacklist such as ^rm does NOT block this tool.

Input Schema

NameRequiredDescriptionDefault
hostYesSSH hostname or IP address
pathYesAbsolute path of the file or empty directory to delete. Must start with /.
portNoSSH port (default: 22)
passwordNoSSH password. STRONGLY prefer key-based auth (privateKeyPath or ssh-agent). Passwords pass through MCP protocol frames as plaintext and may be logged by the transport or host process.
usernameNoSSH username (default: current user)
privateKeyPathNoPath to SSH private key

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.17.0
    • changedInput schema / properties / path / description
      Previous value: -"Absolute path of the file or empty directory to delete"New value: +"Absolute path of the file or empty directory to delete. Must start with /."
  2. Addedv0.11.0

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true and openWorldHint=true, and the description adds context annotations cannot express: path-type auto-detection, the deliberate refusal to recurse, and the 30s pool-wait behavior when SSH_MCP_MAX_POOL_SIZE is exhausted. The only gap is that it does not say what happens on failure (e.g., whether a non-empty directory is rejected with a specific error), so a 4 rather than 5.

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?

Front-loaded with the core action, then the failure-mode caveat, then the routing alternative, then the operational footnote. Every sentence carries non-redundant information an agent needs: none is filler, and length is justified by the number of distinct behavioral traits disclosed.

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?

There is no output schema, so the description must carry the full behavioral picture for a destructive SFTP operation, and it does: what is deleted, what is refused, where to go for recursion, pool-wait behavior, and policy exemption. Nothing an agent needs to call it safely and correctly is missing.

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% -- host, path, port, username, password, and privateKeyPath are all documented with defaults and security warnings in the schema itself. The description adds only that the path type is auto-detected, which mildly supplements the `path` param but does not restate or extend the others. Baseline 3 applies when the schema carries this much detail.

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?

States a specific verb ('Delete') and resource ('a file or empty directory on a remote host via SFTP') and immediately distinguishes itself from siblings by naming ssh_exec as the recursive-delete path and enumerating the exact SFTP ops used (unlink vs rmdir). An agent can separate this from ssh_mkdir, ssh_write_file, and ssh_exec without opening the 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?

Gives an explicit when/when-not pair: use this for files and empty dirs, do NOT use it for recursive deletes -- use ssh_exec with `rm -rf` instead. It also clarifies the scope of command policy (whitelist/blacklist apply only to ssh_exec and ssh_multi_exec), which prevents the agent from wrongly assuming a blacklist guards this call.

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