Skip to main content
Glama

Run a shell command

exec
Destructive

Run a shell command on the server and return its output. Pass project_id to run inside that project's workspace folder, with PORT set to the project's routed port; omit it to run at the server workspace root. For one-off work: installing dependencies, building, inspecting files. Runs as the workspace user, the same one the agent and the apps run as, so what it creates stays editable by both; prefix a command with sudo when it needs root. A project command also gets the project's secrets as env. The command's session ends with the call, so do not use it to start an app or any other long-running process: use start_app, which keeps it running, brings it back after a restart, and tells you whether it answered. Output comes back for about 20 seconds: a command that runs longer keeps going on the server, but its output does not return, and the server's other commands wait for it. Start long work (a big install, a long build) in the background with its output in a file, then read the file.

Input Schema

NameRequiredDescriptionDefault
commandYesThe shell command to run, e.g. "npm install" or "ls -la".
server_idYesThe server's id, as returned by create_server or list_servers.
project_idNoOptional. Run the command inside this project's workspace folder instead of the server workspace root.

Output Schema

NameRequiredDescriptionDefault
stdoutYesWhat the command printed, stdout and stderr together.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Goes well beyond the destructive/openWorld annotations: execution user, sudo requirement, project secrets injected as env, session lifetime tied to the call, the ~20s output window, and the blocking side effect on other commands. These are exactly the traits an agent would otherwise learn by failing.

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?

Dense but front-loaded: purpose, project_id behavior, intended uses, then the critical timeout and long-running caveats. The last two sentences are long and would read better as separate short rules, but nothing is filler.

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?

An output schema exists so return values need no explanation; the description instead covers the operational facts that schema can't convey – timeouts, blocking, environment, permissions, and the correct pattern for long work.

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

Parameters4/5

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

Schema coverage is 100%, so baseline is 3; the description adds real meaning for project_id by explaining the workspace folder, the PORT variable it sets, and the secrets it exposes. server_id and command get no extra detail, but the schema already covers them.

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?

Opens with a specific verb+resource ('Run a shell command on the server and return its output') and immediately distinguishes the two modes via project_id. It also explicitly separates itself from start_app, so an agent can route correctly without opening the schema.

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?

Names concrete intended tasks (installing dependencies, building, inspecting files) and an explicit exclusion with the alternative ('do not use it to start an app... use start_app, which keeps it running'). The when-not is paired with the reason and the sibling that handles it.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.