Skip to main content
Glama
rahulkr
by rahulkr

shell_command

Execute ADB shell commands on Android devices for debugging, testing, and device management through the Enhanced ADB MCP Server.

Instructions

Execute an arbitrary ADB shell command. Use with caution - this gives full shell access.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
commandYes
device_serialNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • Handler and registration for the 'shell_command' tool via @mcp.tool() decorator. Executes arbitrary ADB shell commands using the run_adb helper.
    @mcp.tool()
    def shell_command(command: str, device_serial: str | None = None) -> str:
        """
        Execute an arbitrary ADB shell command.
        Use with caution - this gives full shell access.
        """
        return run_adb(["shell", command], device_serial)
  • Decorator that registers the shell_command function as an MCP tool.
    @mcp.tool()
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It discloses a critical behavioral trait: 'Use with caution - this gives full shell access,' warning about potential risks like destructive actions or security issues. However, it lacks details on permissions needed, rate limits, output format, or error handling, which are important for a tool with such broad access.

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?

The description is extremely concise and front-loaded: two sentences that directly state the purpose and a critical warning. Every sentence earns its place with no wasted words, making it easy to parse quickly.

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 the tool's high complexity (arbitrary shell execution) and lack of annotations, the description is incomplete. It warns about risks but doesn't cover prerequisites, output behavior, or error scenarios. The presence of an output schema helps, but for such a powerful tool, more context on safe usage and limitations is needed to be fully adequate.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/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 undocumented parameters. It mentions 'ADB shell command,' which hints at the 'command' parameter, but doesn't explain the 'device_serial' parameter or provide examples or syntax for commands. With 2 parameters and no schema descriptions, this adds minimal semantic value beyond the schema.

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 clearly states the tool's purpose: 'Execute an arbitrary ADB shell command.' It specifies the verb ('Execute') and resource ('ADB shell command'), making it unambiguous. However, it doesn't explicitly differentiate from sibling tools like 'list_devices' or 'reboot_device', which might also involve ADB commands but are more specific.

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?

The description provides some guidance with 'Use with caution - this gives full shell access,' implying it should be used carefully due to its power. However, it doesn't specify when to use this tool versus more specific siblings (e.g., 'reboot_device' for rebooting) or mention alternatives, leaving usage context somewhat implied rather than explicit.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/rahulkr/r_adb_mcp_server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server