Skip to main content
Glama

execute

Execute shell commands on remote servers via SSH. Specify the server and command; optionally set timeout, working directory, or dry-run preview.

Instructions

Execute a shell command on a single SSH server.

Args: server: Server name (e.g. 'web-prod-01'). Must match a configured server. Use list_servers to see available servers. command: Shell command to execute on the remote server (exactly as it would be typed at a bash prompt). timeout: Command timeout in seconds. Default 30. Range 1–3600. working_dir: Absolute remote directory to cd into before running the command. Uses the server's default_dir from servers.toml if omitted, or the SSH login directory if neither is set. force: If True, bypass the dangerous-command detection regex. Use only for audited bulk operations — the block list catches rm -rf /, mkfs, dd-to-disk, chmod 777 /, and fork bombs. Default False. dry_run: If True, do NOT connect or execute. Return a preview describing what would run (server, command, working_dir, timeout, force). Dangerous-command detection still runs so rejection can be previewed. Useful for LLM plans that want to validate intent before committing. Default False.

Returns: Formatted command execution result with stdout, stderr, and exit code. Long output is truncated at max_output_bytes (default 50 KiB).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
forceNo
serverYes
commandYes
dry_runNo
timeoutNo
working_dirNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior5/5

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

With no annotations provided, the description fully covers behavioral traits: dangerous-command detection (with force bypass), timeout range (1–3600 seconds), output truncation at max_output_bytes, working_dir fallback logic, and dry_run behavior.

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?

The description is well-structured with an Args section and Returns, and every sentence adds value. It is somewhat lengthy but justified by the number of parameters and behaviors; minor trimming could improve conciseness.

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?

Given 6 parameters, no annotations, and presence of output schema (mentioned in Returns), the description thoroughly covers all aspects: parameter details, defaults, edge cases, behavior, and return format. It leaves no critical gaps for the agent.

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?

Schema has 0% description coverage, but the description adds detailed semantics for all 6 parameters: server format and validation, command as bash, timeout units and range, working_dir fallback, force bypass details, and dry_run preview purpose. It also explains return value formatting.

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 clearly states 'Execute a shell command on a single SSH server.' It uses a specific verb ('execute') and resource ('shell command on a single SSH server'), and distinguishes from sibling tools like 'execute_on_group' which targets groups, and file operations.

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?

It explicitly says 'on a single SSH server' and references 'list_servers' to see available servers, implying when to use this tool. It also notes 'dry_run' for validating intent before committing, and by context, alternatives like 'execute_on_group' exist for group 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/blackaxgit/ssh-mcp'

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