Skip to main content
Glama

adb_exec

Run shell commands on an adb-connected Android device and return stdout, stderr, and exit status; use timeouts to terminate hung adb child processes.

Instructions

Run a shell command on an adb-connected Android device (adb -s shell); returns stdout/stderr/exit; timeouts kill the adb child.

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": {
      "serial": "<serial>",
      "command": "<command>"
    },
    "name": "adb_exec"
  }
}

Input Schema

NameRequiredDescriptionDefault
serialYes
commandYes
timeoutMsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.5/5.0
Behavior3/5

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

With no annotations supplied, the description carries the full burden, and it does disclose real behavior: it returns stdout/stderr/exit and that timeouts kill the adb child rather than leaving it running. It does not disclose the privileges the command runs under (root vs shell user), whether state persists between calls, or that arbitrary shell commands can be destructive — meaningful omissions for a general command executor.

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?

One dense sentence with the action front-loaded, followed by the invocation form, the return shape, and timeout semantics. Every clause earns its place and nothing is padded.

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?

Given no annotations, no output schema, and 0% parameter coverage, the definition covers return values and timeout behavior well but leaves significant gaps for an arbitrary-command executor: execution privileges, persistence of shell state, default/bounded timeout values, and safety caveats. It is adequate to invoke the tool but not complete enough to invoke it correctly in edge cases.

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 0%, so the description must compensate for three undocumented parameters. It does map serial to adb -s device selection and mentions timeouts, which adds genuine meaning, but it never states the timeout default (30000) or bounds (100–120000 ms) and gives no constraints on the command string beyond it being a shell command.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description names a specific verb and resource ('Run a shell command on an adb-connected Android device') and even includes the underlying invocation form (adb -s <serial> shell), which is far more concrete than a generic 'execute' tool. It implicitly distinguishes itself from generic siblings like exec/shell_run by being adb-device-scoped, but never names those alternatives, so the differentiation is inferred rather than stated.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

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

Usage is implied by the scope phrase 'adb-connected Android device', which tells an agent this is the choice when targeting a specific physical/emulated device over adb. However, there is no explicit when-to-use versus when-not, no mention of preferring adb_root, adb_screencap, or adb_tap for their specialized operations, and no statement of prerequisites such as an active adb connection.

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