Skip to main content
Glama

phone_shell

Run Android shell commands on the phone as the shell user to inspect settings, logs, packages, and /sdcard files; returns exit code and output after user approval.

Instructions

(Needs Linux tools in this chat, and the user's switch Settings > Background mode > Phone commands) Run a command line on the phone itself, as Android's shell user (what adb shell gives): pm, am, settings, dumpsys, logcat -d, getprop, files under /sdcard. Returns its exit code and output (the last 20,000 characters). The user approves each command on a card first, unless they turned that off. This is not Buddy's Linux: your own shell is for files there. To use the screen, use the phone tools (tap, type_text, ...), not input. Never use it to get around an approval card, a BLOCKED answer or a step the user has to do themselves.

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

Input Schema

NameRequiredDescriptionDefault
commandYesThe command line (run by sh -c)
timeout_sNoDefault 60, max 300

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv2.3.13

TDQS

A4.6/5.0
Behavior5/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 does so: it discloses the execution identity (Android shell user, adb shell equivalent), the return contract (exit code plus last 20,000 characters of output), the per-command user approval card and that it can be disabled, and the prerequisite settings. These are behavioral facts an agent cannot derive from the schema.

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?

Content is front-loaded with the prerequisite, then purpose, return value, approval flow, and exclusions, and nearly every clause carries information. The leading parenthetical prerequisite is dense and slightly awkward, but no sentence is 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 two-parameter command-execution tool with no output schema and no annotations, the definition covers prerequisites, execution context, output format and truncation, the approval gate, and misuse boundaries. An agent has enough to decide whether to call it and what to expect back.

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 both parameters are already documented, including that the command runs under sh -c and the timeout default/max. The description adds no further parameter-level detail (it never mentions timeout behavior or what happens on timeout), so the baseline 3 is appropriate.

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 command line on the phone itself, as Android's shell user') and scopes it with concrete examples (pm, am, settings, dumpsys, logcat -d, getprop, /sdcard files). It explicitly separates itself from Buddy's Linux shell and from the screen-control tools, so an agent can distinguish it from siblings without opening another 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?

Gives explicit when-to-use (Android shell operations like pm/am/dumpsys) and when-not-to-use (screen interaction belongs to the phone tools, not `input`; file work in Buddy's Linux belongs to your own shell). It also names hard prohibitions: never use it to get around an approval card, a BLOCKED answer, or a step the user must do themselves.

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