Skip to main content
Glama

execute

Run shell commands in SSH or local terminal sessions. Handles long-running processes and interactive commands with partial output support.

Instructions

Execute a command in a session (SSH or local). Always use this to run
shell commands — there is no persistent shell between calls, so chain
state-changing commands with && (e.g. "cd /foo && ls").

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, tmux, vim) MUST be started in foreground.
Do NOT background them with `&` — that breaks their initialization. The
"partial" return after a short timeout is expected and correct; the
server has already daemonized itself 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 (e.g., 'ls -la' or 'npm run build'). Can chain multiple commands with && or ;
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)
Behavior4/5

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

With no annotations provided, the description thoroughly covers return statuses, timeout behaviors (pause_timeout vs total_timeout), and special considerations for long-running commands. It could mention security implications or permission requirements, but overall is highly transparent.

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 clear sections: purpose, return format, special advice, parameter details. While slightly lengthy, each sentence adds value and the structure aids readability.

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 4 parameters and no output schema, the description explains return behavior and timeout distinctions. It implicitly connects to sibling tools for partial results. Could explicitly link session_id to connect_ssh/create_local, but overall complete for execution context.

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%, and the description adds value by explaining pause_timeout as 'seconds of output silence' and total_timeout as 'hard cap on call duration', with usage advice for quiet jobs. This augments the schema definitions.

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)' and distinguishes from sibling tools like read_output, respond, and send_control by explaining how they handle partial results. It clearly identifies the tool's scope and resource.

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?

Provides explicit when-to-use guidance: 'Always use this to run shell commands' and explains no persistent shell between calls, requiring chaining with &&. Also advises against backgrounding TUI apps and clarifies when to use sibling tools for further interaction.

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