Skip to main content
Glama
liang04
by liang04

execute_command

Execute shell commands on remote servers via SSH connections. Run commands with configurable timeout and output limits, returning execution results including exit codes and output.

Instructions

在远程服务器上执行shell命令

Args:
    command: 要执行的shell命令
    timeout: 命令执行超时时间(秒),默认30秒
    max_output_size: 最大输出大小(字节),默认8192(8KB)。
                    设置为0表示不限制(注意可能导致内存问题)。
                    超过限制的输出会被截断。
    connection_name: SSH连接名称,如果不指定则使用默认连接

Returns:
    Dict包含执行结果:
    - success: 是否成功执行
    - exit_code: 命令退出码
    - stdout: 标准输出
    - stderr: 标准错误输出
    - truncated: 输出是否被截断
    - error: 错误信息(如果有)
    - connection: 使用的连接名称

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
commandYes
timeoutNo
max_output_sizeNo
connection_nameNo
Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure and does so effectively. It describes timeout behavior, output truncation risks, memory concerns with unlimited output, default connection fallback, and detailed return structure including success status, exit codes, output streams, truncation flags, and error information. This provides comprehensive behavioral context beyond basic functionality.

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 perfectly structured and front-loaded with the core purpose first, followed by organized parameter explanations and return value documentation. Every sentence earns its place by providing essential information without redundancy. The bilingual format (Chinese purpose with English parameter names) is efficiently handled without wasting space.

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 complexity of remote command execution with 4 parameters, no annotations, and no output schema, the description provides complete context. It covers the tool's purpose, all parameter meanings with defaults and warnings, detailed return structure, and behavioral characteristics like timeout handling and output truncation. This is comprehensive for an agent to understand and use the tool correctly.

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?

With 0% schema description coverage, the description fully compensates by providing detailed semantic information for all 4 parameters. It explains what each parameter controls (command to execute, timeout seconds, output size limit with memory warnings, optional connection name with default behavior), including default values, special cases (0 for unlimited), and practical implications. This adds significant value beyond the bare 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 clearly states the specific action ('在远程服务器上执行shell命令' - execute shell commands on remote servers) and distinguishes it from siblings like check_ssh_connection (verification), download_file/upload_file (file transfer), list_directory (browsing), and execute_interactive_command (interactive execution). It precisely identifies both the verb (execute) and resource (shell commands on remote servers).

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 provides clear context about when to use this tool (for executing shell commands on remote servers) and implicitly distinguishes it from execute_interactive_command by describing batch execution with timeout and output limits. However, it doesn't explicitly state when NOT to use this tool or provide direct comparison statements with alternatives like 'use execute_interactive_command for interactive sessions'.

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

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