Skip to main content
Glama

Execute a command in a tmux session

exec

Run a shell command in a tmux session, wait up to a timeout, then return the exit code and cleaned output; force is required for foreign or non-shell targets.

Instructions

Type a command into a session, wait for it to finish (bounded by timeout_ms), and return the exit code and cleaned output. Defaults to the owned session "mcp". Foreign, attached, or non-shell targets require force: true. The default timeout is 30 seconds; on timeout the command is left running and the partial output is returned.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "command": "<command>"
    },
    "name": "exec"
  }
}

Input Schema

NameRequiredDescriptionDefault
forceNoAllow writing to a foreign, attached, or non-shell target
commandYesShell command to run
sessionNoTarget session (default: owned session "mcp")
timeout_msNoWait timeout in milliseconds (default: 30000)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.2/5.0
Behavior4/5

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

No annotations exist, so the description carries the full burden, and it does well: it discloses blocking-with-timeout semantics, the 30-second default, and that on timeout the command is left running with partial output returned. It omits permission/auth requirements and what happens if the target session does not exist.

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?

Three sentences, each earning its place: the core behavior first, then the force gate, then timeout behavior. No filler or repetition of schema fields.

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?

With no annotations and no output schema, the description usefully covers the return values (exit code plus cleaned output) and failure-mode behavior on timeout. Remaining gaps, session existence requirements and authorization, are minor for a command-execution 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 coverage is 100%, so all four parameters are already documented, which sets the baseline at 3. The description reinforces the force gating condition and the timeout default/expiry behavior, but adds no new syntax or range information beyond the 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?

States a specific verb chain (type a command, wait, return exit code and cleaned output) against a named resource, a tmux session. That blocking, output-returning behavior implicitly separates it from fire-and-forget siblings such as send_keys, so an agent can pick 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 Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives concrete selection conditions: it defaults to the owned session "mcp", and foreign, attached, or non-shell targets require force: true. It does not explicitly name an alternative tool for cases where you do not want to wait, but the context is clear enough to act on.

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