Skip to main content
Glama

adb_shell

Run any ADB shell command on a connected Android device and return its output for tasks not covered by dedicated tools, including dumpsys, pm, am, settings, and getprop.

Instructions

Run any adb shell command on the device and return its output - dumpsys, pm, am, settings, getprop, input, wm, content, and so on. Use it for what the other tools do not cover; prefer them when they do. Runs as the shell user (no root). Can be switched off with ADBAI_NO_SHELL=1.

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": "adb_shell"
  }
}

Input Schema

NameRequiredDescriptionDefault
deviceNoserial, ip[:port] or saved alias; omit to use the default device
commandYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.9/5.0
Behavior3/5

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

With no annotations, the description carries the full burden, and it does disclose two real traits: execution context ("Runs as the shell user (no root)") and an operational kill switch ("Can be switched off with ADBAI_NO_SHELL=1"). It is silent on timeouts, output truncation for large dumps, exit-code/error surfacing, and the arbitrary-code-execution risk — material gaps for an unannotated mutation-capable tool.

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 tight sentences, front-loaded with capability, then routing, then execution context and the disable flag. No filler or repetition of the tool name.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a no-annotation, no-output-schema escape-hatch tool, the description covers intent, privilege level, and opt-out, but leaves an agent without information on output shape (raw text? truncated?), failure behavior, or latency expectations for long-running commands.

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 50%: `device` is documented in the schema while `command` has no schema description. The description partially compensates by listing example command families for `command`, which conveys its expected content, but it adds nothing about `device` selection or how the default device is resolved.

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 pairs a specific verb and resource ("Run any adb shell command on the device and return its output") and enumerates concrete command families (dumpsys, pm, am, settings, getprop, input, wm, content). It also draws the boundary against the 20+ adb_* siblings by positioning itself as the catch-all fallback.

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?

"Use it for what the other tools do not cover; prefer them when they do" gives an explicit routing rule between this tool and the specialized siblings. The guidance is collective rather than naming specific alternatives, and it offers no guidance on when a raw shell command is inadvisable (e.g. operations the siblings handle more safely).

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