Skip to main content
Glama

Run Shell Command

device_shell
Destructive

Execute arbitrary ADB shell commands on a connected Android device, targeting a specific serial when needed, to inspect or control devices from within the IDE.

Instructions

Execute an arbitrary ADB shell command on a connected Android device. Use with caution

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

Input Schema

NameRequiredDescriptionDefault
commandYesShell command to execute on the device
deviceIdNoTarget device serial

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.1.0

TDQS

C2.9/5.0
Behavior2/5

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

Annotations already declare destructiveHint=true, readOnlyHint=false, idempotentHint=false, so 'Use with caution' merely echoes what structured data provides. Nothing is said about execution timeouts, blocking behavior, whether output is returned or truncated, or the privilege level the command runs under.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two short sentences, front-loaded with the action and scope. There is no filler, though the trailing caution clause is generic and borderline redundant with the annotations.

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

Completeness2/5

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

This is an arbitrary-code-execution surface with no output schema, yet the description explains nothing about what comes back (stdout/stderr, exit code), how long it may run, or what side effects on device state are possible. For a destructive, non-idempotent tool, that is a meaningful gap.

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 100%, so both the command string and the target device serial are already documented. The description adds no syntax, quoting, or multi-command chaining detail beyond the schema, so the baseline 3 applies.

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?

States a specific verb and resource: 'Execute an arbitrary ADB shell command on a connected Android device.' The word 'arbitrary' implicitly distinguishes it from the task-specific siblings like device_screenshot or app_launch, though no sibling is named explicitly.

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

Usage Guidelines2/5

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

'Use with caution' is a safety tone, not usage guidance. The description never says when to prefer this general shell tool over the narrower siblings, nor when to avoid it (e.g., use app_clear_data instead of shelling 'pm clear').

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