Skip to main content
Glama

Install an APK

android_install
Idempotent

Installs an APK on an Android device, replacing the existing app. Accepts an explicit APK path or uses the latest Gradle build output, with options for module, variant, device, and permission grants.

Instructions

Install an APK onto a device, replacing any existing copy.

Args:

  • apk_path (string, optional): absolute path to the APK. Omit to use the last build output of project_path.

  • project_path (string, optional): Gradle root, used to locate the APK when apk_path is omitted

  • module (string): module that produced the APK (default: 'app')

  • variant ('debug' | 'release'): which build output to install (default: 'debug')

  • serial (string, optional): target device

  • grant_permissions (boolean): grant all runtime permissions at install time (default: false)

Returns: { "installed": boolean, "apkPath": string, "serial": string }

Examples:

  • Use when: an APK was built earlier and you want it on the device -> project_path=...

  • Use when: installing a downloaded APK -> apk_path=...

  • Don't use when: you also need to compile first (use android_build with install=true)

Error Handling:

  • INSTALL_FAILED_UPDATE_INCOMPATIBLE: the installed copy was signed with a different key; uninstall it first

  • INSTALL_FAILED_VERSION_DOWNGRADE: the device has a newer versionCode; uninstall or bump the version

  • INSTALL_FAILED_INSUFFICIENT_STORAGE: free space on the device

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
moduleNoGradle module that produces the APK. Almost always 'app'.app
serialNoDevice serial from android_list_devices. Optional when exactly one device is connected; required when several are.
variantNoBuild variant. 'release' requires signing config to be set up in the project.debug
apk_pathNoAbsolute path to an APK file.
project_pathNoGradle root, used to find the APK when apk_path is omitted.
grant_permissionsNoGrant all runtime permissions listed in the manifest (adb install -g).
Behavior5/5

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

The description adds significant behavioral context beyond annotations: it replaces existing copies, details three common error codes with remedies, and clarifies that grant_permissions uses adb install -g. Annotations already indicate readOnlyHint=false and idempotentHint=true, and the description does not contradict them.

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 well-organized into Args, Returns, Examples, and Error Handling sections. It is detailed but every sentence earns its place; no fluff or repetition of schema fields, as it adds usage context instead.

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?

Despite having no output schema, the description explicitly documents the return object with fields. It also covers error handling and prerequisites (e.g., release requires signing config). This makes it fully self-contained for an agent to invoke correctly.

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

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so baseline is 3. The description adds extra semantics by explaining that apk_path can be omitted to use the last build output of project_path, and provides usage examples that map parameters to real scenarios. This goes beyond the schema's basic field descriptions.

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?

The first sentence clearly states the action: 'Install an APK onto a device, replacing any existing copy.' This distinguishes it from siblings like android_build (which compiles) and android_uninstall. The examples further reinforce the specific use cases for apk_path vs project_path.

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?

The description contains explicit 'Use when' and 'Don't use when' examples, including a named alternative: 'Don't use when: you also need to compile first (use android_build with install=true)'. This gives clear situational guidance.

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/jjs03111/android-build-mcp'

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