Skip to main content
Glama

build_and_run

Builds, installs, and launches an Android app in one call: runs the Gradle task, installs the newest non-test APK on the device, then launches the package.

Instructions

One-shot build → install → launch: runs Gradle (default task assembleDebug) in project_dir, installs the resulting APK on the device, and launches package. Equivalent to gradle_build + install_app + launch_app in a single call, and it blocks for the whole build. A failed build returns the same summary and full-log path as gradle_build. If several APKs exist under build/outputs (multi-flavor projects, leftover androidTest APKs), the newest non-test one is installed.

Input Schema

NameRequiredDescriptionDefault
argsNoExtra arguments passed to Gradle (e.g. --stacktrace, -Pflavor=free).
taskNoGradle task to run. Defaults to assembleDebug.
serialNoTarget device serial (adb -s). Optional when exactly one device is attached.
packageYesApplication package name to install and launch, e.g. com.example.app.
project_dirNoPath to the Android project root containing the Gradle wrapper (gradlew). Optional if session_set_defaults has pinned a project_dir for this session.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.4/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does substantial work: it discloses blocking semantics, the default task, the failure path (same summary and full-log path as gradle_build), and the non-obvious APK selection rule ('newest non-test one'). Missing is any statement about return values on success, expected duration, or whether the launch step waits for the app to be ready.

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?

Three sentences, front-loaded with the core build→install→launch chain, then the equivalence to siblings, then the failure and APK-selection edge cases. No filler; each sentence covers a distinct decision-relevant fact.

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

Completeness4/5

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

For a 5-parameter composite tool with no annotations and no output schema, the description covers the important behaviors: blocking, defaults, failure semantics, and artifact choice. The one gap is that, absent an output schema, it doesn't describe what a successful call returns, so an agent cannot anticipate the result payload.

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 the baseline is 3, but the description adds real meaning beyond the schema by explaining that project_dir may be pinned via session_set_defaults and by clarifying which APK from build/outputs gets used in multi-flavor or leftover-androidTest scenarios. That is semantics the schema cannot express.

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?

A specific verb chain (build → install → launch) with the exact mechanics named: Gradle task, APK install on device, package launch. It also distinguishes itself from siblings by explicitly stating it is equivalent to gradle_build + install_app + launch_app combined, so an agent can place it precisely in the tool set.

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

Usage Guidelines4/5

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

By naming the three component tools it replaces and noting that it 'blocks for the whole build,' it gives a clear basis for choosing it over the granular siblings. It stops short of an explicit 'use this when you want X, use gradle_build when you want Y' rule and never names when *not* to use it — e.g. when you want to inspect build output before installing.

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