Skip to main content
Glama

execute

Destructive

Run shell commands in isolated SSH or local sessions, with support for long-running tasks and interactive input management via command IDs.

Instructions

Execute a command in a session (SSH or local). Each call runs in an
isolated channel — there is NO persistent shell between calls. For simple
tasks chain with && ("cd /foo && ls"); for persistent state (cd, venv, env
vars) start a Zellij session and drive it via CLI instead.

Returns a dict:
  status="completed":  exit_code, output filled in. Command is done.
  status="partial":    command_id filled in. Command is still running.
                       Continue with one of:
                         read_output(cid) — no input needed (logs/build)
                         respond(cid, text) — command awaits input
                         send_control(cid, key) — send Ctrl+C / arrows / F-keys
                         (do nothing, let it run — fine for daemons)

Long-running TUI apps (zellij, vim) MUST be started in foreground. Do NOT
background them with `&` — it breaks their init. The "partial" return after
a short timeout is expected: the server has already daemonized and is safe
to abandon.

Args:
- pause_timeout: seconds of OUTPUT SILENCE before returning (default 9.0).
  Dominates return time for silent commands — raise this (not
  total_timeout) when polling a quiet long-running job.
- total_timeout: hard cap on this call's duration (default 20.0). Only
  binds while output is actively streaming.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
session_idYesThe unique session identifier returned by connect_ssh or create_local
commandYesThe shell command to execute. Each call is stateless; for persistent state (cd, venv, env vars), drive a Zellij session instead of chaining &&
pause_timeoutNoSeconds of output silence to wait before returning a partial response (default is 9.0)
total_timeoutNoHard cap in seconds on the maximum duration of this call (default is 20.0)
Behavior5/5

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

Beyond the annotations (destructiveHint=true, readOnlyHint=false), the description adds critical behavioral context: each call is stateless, runs in an isolated channel, and describes the return dict with statuses. It also warns about not backgrounding processes, which is not evident from 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?

The description is well-structured with paragraphs and bullet-like enumeration. It front-loads the core purpose. While somewhat long, every sentence adds value and there is minimal redundancy.

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 tool complexity (4 params, no output schema), the description is highly complete. It explains the two statuses, how to handle partial responses, and the timeout parameters in practical terms. No gaps remain.

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 value by explaining the behavior of pause_timeout and total_timeout with practical examples (e.g., raising pause_timeout for quiet jobs) and reinforcing the stateless nature of the command parameter.

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 explicitly states 'Execute a command in a session (SSH or local).' It uses specific verbs and resources, and distinguishes from sibling tools by highlighting the isolated channel nature and the alternative for persistent state via Zellij.

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?

The description provides clear when-to-use guidance: for simple commands. It explicitly advises against using it for persistent state, recommending a Zellij session instead. It also details how to handle partial responses with specific next steps and warns against backgrounding TUI apps.

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/QiuwenZheng/interminal'

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