Skip to main content
Glama

Run a shell command in Termux

run_command
Destructive

Executes a bash command as the Termux user and returns exit code, stdout, stderr, duration, and truncation flags for automation and diagnostics.

Instructions

Run a command with bash -c as the Termux user and return exit code, stdout, stderr, duration and truncation flags. Use cwd for the working directory and timeout_sec for long jobs. There is no command allow list: the command runs with the full permissions of the Termux user. A non-zero exit code is returned as data, not as a tool failure. For long-running or interactive work use the task_* or terminal_* tools.

Input Schema

NameRequiredDescriptionDefault
cwdNoWorking directory. Default $HOME.
envNoExtra environment variables.
stdinNoText written to the command standard input.
commandYesShell command to execute with bash -c.
timeout_secNoTimeout in seconds. Default 120, max 600.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.5/5.0
Behavior5/5

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

Goes well beyond the destructive/openWorld annotations: no command allow list, runs with full Termux user permissions, and non-zero exit codes come back as data rather than tool errors. The explicit statement that failures are data is exactly the kind of thing an agent cannot infer 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.

Conciseness5/5

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

Four tight sentences: behavior and return shape first, then the permissions caveat, then error semantics, then the alternative routing. No filler and nothing buried.

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?

With no output schema, the description supplies the return fields (exit code, stdout, stderr, duration, truncation) and the error-handling contract. Combined with full schema coverage of the five parameters, an agent has everything needed to invoke it safely.

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 cwd, timeout_sec, env and stdin are already documented. The description only echoes cwd and timeout_sec usage without adding format or interaction detail, so the baseline 3 applies.

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+resource (run a shell command via bash -c as the Termux user) and even enumerates the returned fields. An agent can distinguish it from read_file/write_file or terminal_* siblings without reading any 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?

Explicitly routes long-running or interactive work to task_* or terminal_* tools, which is real when-to-use guidance. It does not say when to prefer file-oriented siblings (read_file, write_file, list_dir) over a raw shell command, so one gap remains.

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