Skip to main content
Glama

run_ssh_command

Execute pre-approved SSH commands on remote Linux servers using command templates for tasks like checking disk usage, monitoring services, viewing logs, and listing processes.

Instructions

Execute a pre-approved command template on a target host.

Use list_templates to discover available template_ids. Examples:

  • disk_usage: run df -h (no params needed)

  • service_status: check a systemd service (params: {"service": "docker"})

  • list_processes: show top processes by memory (no params needed)

  • tail_log: tail a log file (params: {"lines": "100", "log_path": "/var/log/syslog"})

Only commands from the template registry are allowed. Parameters are validated against per-template regex rules. Output is automatically redacted for secrets.

Pass session_id from ssh_connect to reuse a persistent connection.

Risk level: medium (requires user confirmation in VS Code).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
host_idYes
template_idYes
paramsNo
session_idNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior5/5

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

With no annotations provided, the description carries full behavioral disclosure burden and succeeds admirably. It discloses validation behavior ('validated against per-template regex rules'), security processing ('Output is automatically redacted for secrets'), safety requirements ('requires user confirmation in VS Code'), and connection state management ('reuse a persistent connection').

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?

Information density is high with zero waste. The structure flows logically: purpose → prerequisite → concrete examples → constraints → validation → security → optimization → risk. Every sentence provides unique value not available in the schema, and the examples efficiently illustrate parameter patterns for the polymorphic 'params' field.

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 complex operation involving SSH execution, template registries, dynamic parameters, and security redaction, the description is remarkably complete despite zero schema annotations. It covers discovery workflows, security constraints, output processing, and connection reuse patterns. Since an output schema exists, the description appropriately omits return value details.

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

Parameters5/5

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

Given 0% schema description coverage (only titles like 'Host Id'), the description fully compensates by explaining all four parameters through context and examples. It illustrates 'params' structure with concrete JSON examples (e.g., {"service": "docker"}), explains 'session_id' sourcing from ssh_connect, and clarifies 'template_id' discovery via list_templates.

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 description opens with a precise action ('Execute a pre-approved command template') and clearly identifies the target resource ('target host'). It effectively distinguishes this tool from arbitrary command execution tools by emphasizing the 'pre-approved' constraint and template registry requirement, setting clear boundaries against siblings like direct SSH tools.

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

Usage Guidelines4/5

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

Provides explicit workflow guidance by directing users to 'Use list_templates to discover available template_ids' and referencing 'ssh_connect' for obtaining session_id. While it establishes the prerequisite chain clearly, it does not explicitly contrast with 'run_ssh_command_background' to guide when to use foreground versus background execution.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/bhayanak/ssh-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server