Skip to main content
Glama

execute_command

Run shell commands synchronously and capture their output. Use for CLI tools, build scripts, version control, package managers, and system commands.

Instructions

EXECUTE SHELL COMMANDS synchronously and get output. Use for running CLI tools, build scripts, version control, package managers. Common uses: git commands, npm/pip/go commands, Python/Node.js scripts, build tools. IMPORTANT: Do NOT use for file operations - use dedicated file tools instead. Keywords: execute, run, command, shell, bash, terminal, cli, script, git, npm, python. / 同步执行shell命令并获取输出。用于运行CLI工具、构建脚本、版本控制、包管理器。常见用途:git命令、npm/pip/go命令、Python/Node.js脚本、构建工具。重要:不要用于文件操作 - 请使用专用的文件工具。关键词:执行、运行、命令、shell、终端、脚本。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
argsNoCommand arguments as separate list elements. Each argument is a separate string. Examples: For 'git commit -m "message"' use ['commit', '-m', 'message']. For 'npm install express' use ['install', 'express']. For 'python script.py --arg value' use ['script.py', '--arg', 'value'].
commandYesThe command executable name (without arguments). This is the program to run. Examples: 'git' (version control), 'npm' (Node.js package manager), 'python' (Python interpreter), 'go' (Go compiler), 'ls' (list files), 'make' (build tool), 'docker' (container tool).
timeoutNoMaximum time in seconds to wait for command completion. 0 means no timeout (wait indefinitely). Use reasonable timeouts: 30s for quick commands, 300s (5min) for builds, 0 for long-running tasks. Default is 0.
work_dirYesThe working directory where the command will be executed. Can be absolute or relative to the sandbox root. Use '.' for current directory. The command will run as if you cd'd into this directory first.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
stderrYes
stdoutYes
messageYes
successYes
exit_codeYes
command_lineYes
current_work_dirYes
Behavior3/5

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

With no annotations provided, the description carries the full burden. It adds useful behavioral context: commands run synchronously and wait for completion. However, it does not disclose potential side effects (e.g., commands can modify the filesystem), permission requirements, blacklist constraints, or output size limits. The description is not misleading but leaves significant behavioral aspects unrevealed.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is reasonably sized but includes redundancy: the top-level description and the schema description are near-identical, and 'Common uses' plus 'Keywords' overlap heavily. The Chinese translation doubles the length, which may aid multilingual users but is not strictly concise. It is front-loaded with the core message, yet the keyword list and repetition make it less efficient than it could be.

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?

Given the tool's complexity (4 params, output schema present), the description covers the essential context: execution model (synchronous), common use cases, and an explicit exclusion. The schema provides parameter details and the output schema covers return values, so the description does not need to explain those. It lacks mention of sandbox/permission constraints, but overall it is sufficiently complete for an agent to understand when and how to use the tool.

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

Parameters3/5

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

Schema description coverage is 100%, and the schema itself provides detailed parameter semantics (e.g., args as separate list elements, timeout meaning, work_dir behavior). The main description does not add parameter-level information beyond what the schema already states. Therefore, the baseline score of 3 applies; the schema handles the heavy lifting and the description offers no additional clarification.

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 tool executes shell commands synchronously and returns output. It specifies common use cases (git, npm, Python scripts, build tools) and explicitly differentiates from file operations, making its purpose unambiguous. The synchronous nature also distinguishes it from the sibling execute_command_async.

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 usage context: 'Use for running CLI tools, build scripts, version control, package managers' and lists examples. It also gives an explicit exclusion with a pointer to alternatives: 'Do NOT use for file operations - use dedicated file tools instead.' However, it does not explicitly mention the sibling execute_command_async for background execution, even though 'synchronously' implies it. So it has clear context and one explicit alternative, but not full alternative coverage.

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/shibingli/mcp-toolkit'

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