Skip to main content
Glama

adb_install

DestructiveIdempotent

Install a signed APK onto a connected Android device via adb. Set reinstall to replace an existing app while keeping its data; unsigned APKs are rejected.

Instructions

Install an APK from this machine onto a connected device via adb install. The APK must already be signed (build_apk output is unsigned and will be rejected). Without reinstall, installing a package that's already present fails; with reinstall it replaces the installed version and keeps its app data. Returns { apkPath, stdoutTail, stderrTail? } - adb prints "Success" on success and an error like INSTALL_FAILED_* otherwise. To remove an app or run other device commands use adb_shell. Requires adb on PATH and an authorized device.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
apkPathYesAbsolute path, on this machine, of the signed .apk to install. Must exist.
reinstallNoPass -r so an existing install is replaced (app data is kept). Default false.
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. Changed5 schema fields changedv1.3.7
    • addedInput schema / properties / apkPath / description
      Added value: +"Absolute path, on this machine, of the signed .apk to install. Must exist."
    • addedInput schema / properties / deviceSerial / description
      Added value: +"Device serial from adb_devices, e.g. \"emulator-5554\" or \"R58M123ABC\". Only needed when more than one device is connected; omit otherwise."
    • addedInput schema / properties / reinstall / default
      Added value: +false
    • changedInput schema / properties / reinstall / description
      Previous value: -"Pass -r to allow reinstalling over an existing install"New value: +"Pass -r so an existing install is replaced (app data is kept). Default false."
    • 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 cover the safety profile (readOnly=false, destructive=true, openWorld=true), and the description adds substantial context beyond them: signature precondition, the replace-vs-fail distinction controlled by reinstall, preservation of app data, the success/INSTALL_FAILED_* error surface, and environment prerequisites. The only minor tension is the idempotentHint=true annotation versus the documented failure on a repeat install without reinstall, but the description explains that nuance rather than contradicting it.

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?

Four dense sentences, zero filler: purpose first, then precondition, then the branching reinstall behavior, then return shape and the sibling hand-off. Every sentence carries information an agent needs.

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?

Although there is no output schema, the description supplies the return shape ({ apkPath, stdoutTail, stderrTail? }) and how to interpret it ('Success' vs INSTALL_FAILED_*), plus environment prerequisites. Nothing needed for correct invocation is missing.

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 all four parameters are already documented in the schema (apkPath absolute/exists, reinstall -r and data retention, workspace job recording, deviceSerial from adb_devices). The description largely restates the reinstall semantics rather than adding new syntax or format guidance. 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 precise verb+resource+mechanism ('Install an APK from this machine onto a connected device via `adb install`') and implicitly distinguishes itself from build_apk (output is unsigned, will be rejected) and adb_shell (used for removal/other commands). An agent can place this tool among its 19 siblings without opening a 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?

Explicit about when the tool works and when it fails (APK must already be signed; unsigned build_apk output is rejected), what reinstall changes (fails if present vs. replaces and keeps app data), prerequisites ('adb on PATH and an authorized device'), and names the alternative for other device operations (adb_shell).

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