Skip to main content
Glama

adb_shell

Destructive

Run a single shell command on a connected Android device to inspect or modify device state as its shell user; not for interactive input or APK installs.

Instructions

Run one shell command on a connected Android device via adb shell. As powerful as adb shell itself and can change or delete anything the device's shell user can - only use against a device you control. Not interactive (a command that waits for input will hang). Returns { command, stdout, stderr? } with stdout cut to its last 4000 characters and stderr to its last 2000. For installing an APK use adb_install; for reading logs use adb_logcat. Requires adb on PATH and an authorized device.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
commandYesThe command line to run on the device, as one string, e.g. "pm list packages -3" or "getprop ro.build.version.release".
workspaceNoWorkspace name (not id). Created if it doesn't exist, and this call is recorded as a job in its history. Defaults to "default".
deviceSerialNoDevice serial from adb_devices, e.g. "emulator-5554" or "R58M123ABC". Only needed when more than one device is connected; omit otherwise.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv1.3.7
    • addedInput schema / properties / command / description
      Added value: +"The command line to run on the device, as one string, e.g. \"pm list packages -3\" or \"getprop ro.build.version.release\"."
    • changedInput schema / properties / deviceSerial / description
      Previous value: -"Only needed with more than one device connected"New value: +"Device serial from adb_devices, e.g. \"emulator-5554\" or \"R58M123ABC\". Only needed when more than one device is connected; omit otherwise."
    • changedInput schema / properties / workspace / description
      Previous value: -"Workspace name (not id) - created automatically if it doesn't exist yet. Defaults to \"default\"."New value: +"Workspace name (not id). Created if it doesn't exist, and this call is recorded as a job in its history. Defaults to \"default\"."
  2. First observedv1.3.0

TDQS

A4.7/5.0
Behavior5/5

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

Annotations already declare destructiveHint=true and openWorldHint=true, and the description adds substantial context beyond them: it can 'change or delete anything the device's shell user can', it is non-interactive and will hang on input, it requires adb on PATH and an authorized device, and it documents the return shape with specific truncation limits (4000/2000 chars). This is richer behavioral disclosure than the structured fields provide.

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 core purpose, then danger warning, then behavior, then sibling routing, then prerequisites. Every sentence carries distinct value 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?

With no output schema, the description fully compensates by documenting the return object and truncation behavior. Combined with prerequisites, interactivity constraints, and sibling routing, an agent has everything needed to call it correctly and 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 description coverage is 100%, so the schema already documents all three parameters thoroughly with examples. The description adds the return structure but no additional syntax or format meaning for the parameters themselves, 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 (run) and resource (one shell command on a connected Android device via adb shell), and explicitly distinguishes itself from siblings adb_install and adb_logcat. An agent can route to the correct tool without opening 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 Guidelines5/5

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

Explicitly names alternatives and the conditions that select them ('For installing an APK use adb_install; for reading logs use adb_logcat'), warns 'only use against a device you control', and notes the non-interactive failure mode (a command waiting for input will hang). Nothing is left to inference.

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