Skip to main content
Glama

Run shell command

adb_shell
Destructive

Run shell commands on an Android device over ADB and return stdout for settings, pm, am, dumpsys, getprop, wm, cmd, or svc. Requires allow_shell; use adb_app for dry-run package changes.

Instructions

Run a shell command on the device (settings, pm, am, dumpsys, getprop, wm, cmd, svc...) and return stdout. It bypasses every guard rail, so it works only while the server option allow_shell is on. For package changes use adb_app instead: dry runs, a protected set, a network guard and a rollback snapshot.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
serialNoDevice serial from adb_devices. Optional when exactly one device is connected.
commandYesCommand line for the device shell, e.g. "getprop ro.build.version.release". Logged verbatim with log_requests: type secrets with adb_text instead.
timeout_secNoTime limit in seconds, default 30, at most 120. Past it the call fails with "timed out".

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.7/5.0
Behavior5/5

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

Annotations already flag this as destructive and non-idempotent, but the description adds material context the annotations cannot: it bypasses every guard rail, it is gated behind the allow_shell server option, and the command is logged verbatim (so secrets should go through adb_text instead). The timeout failure mode ('timed out') is also disclosed. This is well beyond what structured fields convey.

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, front-loaded with what the tool does and its return value, then the precondition, then the sibling routing. Every sentence carries a distinct, load-bearing piece of information with no filler.

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?

For a raw-shell escape hatch, the description covers the safety posture (guard-rail bypass, allow_shell gate), the logging/secret-handling caveat, the failure mode, and the correct sibling for package operations. With annotations supplying the destructive/idempotent profile and the schema complete at 100% coverage, nothing an agent needs before invoking it is missing; return values are summarized as stdout, so no output schema is required.

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 description coverage is 100%, so serial, command, and timeout_sec are already fully documented in the schema, setting the baseline at 3. The description's command-family list and the secrets/log_requests warning echo rather than extend the schema's own parameter descriptions, so no upward adjustment is warranted.

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 a shell command on the device') and enumerates concrete command families (settings, pm, am, dumpsys, getprop, wm, cmd, svc) with the return value ('stdout'). It also distinguishes itself from adb_app by name, so the agent can separate the two without opening either schema.

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?

Explicitly states the precondition ('works only while the server option allow_shell is on') and names the alternative for a whole category of work: 'For package changes use adb_app instead', including the reasons (dry runs, protected set, network guard, rollback snapshot). This is exactly the when-to-use/when-to-use-something-else guidance the dimension asks for.

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