Skip to main content
Glama

execute_script

Run multi-line shell scripts on remote SSH servers for automation, configuration changes, or complex checks. Send script via stdin, choose shell, timeout, and host.

Instructions

Execute a multi-line shell script on the remote SSH server.

Uploads the script via stdin and runs it with the specified shell. Useful for multi-step automation, configuration changes, or complex checks.

Args: script: The full script content (multi-line bash/sh/python script). shell: Shell interpreter to use: "bash", "sh", "python3", etc. (default "bash"). timeout: Maximum seconds to wait (default 120). host_name: Named host from SSH_HOSTS config; uses default host if omitted.

Returns: Script output or error details.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
shellNobash
scriptYes
timeoutNo
host_nameNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior3/5

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

With no annotations, the description carries the full burden. It discloses the execution mechanism (uploads via stdin), shell selection, timeout, and returns output or error. However, it does not warn about potentially destructive side effects or permission requirements, only hinting at 'configuration changes.' This is moderately transparent but lacks a safety profile.

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?

The description is well-structured with a brief intro, useful context, an Args breakdown, and a Returns section. Every sentence provides functional value, and the format is easy to scan, making it an ideal length.

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?

The description covers all parameters, use cases, and return behavior, and the output schema handles return specifics. It lacks an explicit note on whether an SSH connection must already exist or if it auto-connects, which is relevant given the sibling connection-management tools. Overall, it is quite complete but has a small gap.

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 description coverage is 0%, yet the description includes a detailed 'Args' section explaining every parameter: script, shell, timeout, and host_name, including defaults and examples. This fully compensates for the sparse schema and adds meaning beyond the raw JSON schema.

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 specific verb and resource: 'Execute a multi-line shell script on the remote SSH server.' It also distinguishes itself from the sibling execute_command by emphasizing multi-line scripts and multi-step automation, making its purpose unmistakable.

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?

The description states it is 'Useful for multi-step automation, configuration changes, or complex checks,' providing clear context for when to use it. However, it does not explicitly name alternatives or say when not to use it, such as pointing to execute_command for single commands, so it misses a fully explicit guideline.

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

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