Skip to main content
Glama

Run a device shell command

shell

Run arbitrary Android commands via ADB, returning stdout/stderr. Use when dedicated tools don't cover the task.

Instructions

Escape hatch: run an arbitrary command through adb shell on one device and return stdout/stderr. Powerful but not read-only — destructive commands are refused by default (reboot, su, mkfs, wipe, rm of / including split/reordered flags and the /* glob, and pipelines into sh/bash such as curl … | sh or … | sudo bash). This is a guardrail, not a sandbox: a deliberately obfuscated command can still get through. Prefer the dedicated tools (list_packages, install_apk, get_ui_hierarchy, …) when they cover the job. A non-zero remote exit code is reported as exit_code: N in the output. If the call times out, only the host-side adb client is killed; the command keeps running on the device (inherent to adb).

Input Schema

NameRequiredDescriptionDefault
deviceNoDevice serial from list_devices; optional when exactly one device is connected.
commandYesDevice shell command, e.g. "dumpsys battery" or "ls /sdcard/Download".
timeout_msNoCommand timeout in milliseconds (default 30000).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.6.0

TDQS

A4.9/5.0
Behavior5/5

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

Annotations only declare readOnly=false, destructive=false, openWorld=true, idempotent=false; the description goes far beyond by enumerating the refused-command guardrail, warning that it is 'a guardrail, not a sandbox' and can be obfuscated past, and disclosing that a timeout kills only the host-side adb client while the device command keeps running. It also documents that non-zero remote exits surface as `exit_code: N`. No contradiction with annotations — destructive=false is consistent with the stated refusal of destructive commands.

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?

Front-loads the 'Escape hatch' framing and then layers guardrail, routing, and timeout behavior with no filler. Dense but every sentence carries operational information an agent needs.

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 still explains the return surface (stdout/stderr, `exit_code: N` on non-zero) and the timeout side effect. For a high-risk arbitrary-execution tool, the safety caveats and routing guidance make it complete enough to invoke correctly.

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 the baseline is 3; however the description adds real meaning beyond the schema for `timeout_ms` by explaining that on timeout only the host-side adb client is killed and the remote command continues. Device/command semantics are already fully covered by the schema, so this is a modest but genuine addition.

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 and resource ('run an arbitrary command through `adb shell` on one device') plus the return surface (stdout/stderr). It also distinguishes itself from the many dedicated siblings by framing itself as the 'escape hatch' and naming the preferred alternatives (list_packages, install_apk, get_ui_hierarchy).

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?

Explicit routing guidance: 'Prefer the dedicated tools … when they cover the job', with concrete sibling names. It also states the when-not condition — destructive commands (reboot, su, mkfs, wipe, rm of /, pipelines into sh/bash) are refused by default — so the agent knows the boundaries before invoking.

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