Skip to main content
Glama
ifindv
by ifindv

ssh_execute

Read-onlyDestructive

Execute shell commands on remote servers via SSH with captured stdout, stderr, and exit codes for system administration and automation tasks.

Instructions

Execute a command on the remote server via SSH.

This tool runs a shell command on the connected server and captures stdout, stderr, and exit code. The command runs in a non-interactive shell.

Args: params (ExecuteInput): Validated input parameters containing: - session_id (str): SSH session identifier from ssh_connect - command (str): Command to execute on remote server (e.g., "ls -la", "whoami", "cat /etc/os-release") - working_directory (Optional[str]): Working directory for command execution (e.g., "/var/log") - timeout (int): Execution timeout in seconds, default 30, range 1-600 - response_format (ResponseFormat): Output format (markdown or json)

Returns: str: Command execution result with stdout, stderr, and exit code

Examples: - Use when: "Check what Linux distribution is running" -> params with command="cat /etc/os-release" - Use when: "List files in /var/log" -> params with command="ls -la /var/log" - Use when: "Check disk usage" -> params with command="df -h" - Don't use when: Need interactive commands (e.g., vim, top - use non-interactive alternatives) - Don't use when: Need to run multiple commands in sequence (execute tools separately)

Error Handling: - Returns "Error: Session not found" if session_id is invalid - Returns execution result with non-zero exit code if command fails - Returns timeout error if command exceeds timeout limit

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
paramsYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior5/5

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

Annotations include readOnlyHint=true and destructiveHint=true, and the description adds context about non-interactive shell execution and error handling (session not found, timeout). No contradiction with annotations.

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?

Well-structured with sections (Args, Returns, Examples, Error Handling). Some redundancy could be trimmed, but overall efficient for the information provided.

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 the nested parameter structure and presence of an output schema, the description covers purpose, parameters, usage guidelines, error handling, and output format comprehensively.

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?

Although schema description coverage is 0%, the tool description clearly explains each parameter (session_id, command, working_directory, timeout, response_format) with examples and constraints (e.g., timeout range 1-600).

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?

Clearly states the tool executes a command on a remote server via SSH, capturing stdout, stderr, and exit code. Distinguishes from sibling tools like ssh_connect and ssh_download_file by focusing on command execution.

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?

Provides specific when-to-use examples (e.g., 'Check what Linux distribution is running') and explicit when-not-to-use cases (interactive commands, sequential commands). Also notes the prerequisite of a session_id from ssh_connect.

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/ifindv/ssh-mcp'

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