Skip to main content
Glama

adb_farm_run

Run instrumented Android tests on Firebase Test Lab: upload app and test APKs, select device models and API levels, and execute tests via authenticated gcloud CLI.

Instructions

Run tests on Firebase Test Lab. Uploads an APK and test APK, executes instrumented tests across specified device models and API levels. Requires gcloud CLI authenticated with a Firebase project.

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": {
      "appApk": "<appApk>",
      "testApk": "<testApk>"
    },
    "name": "adb_farm_run"
  }
}

Input Schema

NameRequiredDescriptionDefault
appApkYesPath to the app APK file
devicesNoDevice specs as 'model=DEVICE,version=API' (e.g., 'model=bluejay,version=33'). Omit for default device.
testApkYesPath to the test/instrumentation APK file
timeoutNoTest timeout passed to gcloud --timeout (e.g., '300s', '10m'). This is the LAB-side timeout.300s
testTargetsNoSpecific test class or method (e.g., 'class com.example.MyTest')
execTimeoutMsNoLocal execFile timeout for the gcloud invocation in ms (1min-60min, default 10min). Y4 fix: bigger device matrices or larger APKs can plausibly exceed the previous hardcoded 10min.
resultsBucketNoGCS bucket for results (omit for default)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv1.1.6
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
  2. Changed3 schema fields changedv1.1.3
    • removedInput schema / additionalProperties
      Removed value: -false
    • addedInput schema / properties / execTimeoutMs
      Added value: +{
      +  "default": 600000,
      +  "description": "Local execFile timeout for the gcloud invocation in ms (1min-60min, default 10min). Y4 fix: bigger device matrices or larger APKs can plausibly exceed the previous hardcoded 10min.",
      +  "maximum": 3600000,
      +  "minimum": 60000,
      +  "type": "integer"
      +}
    • changedInput schema / properties / timeout / description
      Previous value: -"Test timeout (e.g., '300s', '10m')"New value: +"Test timeout passed to gcloud --timeout (e.g., '300s', '10m'). This is the LAB-side timeout."
  3. First observedv1.1.1

TDQS

B3.4/5.0
Behavior3/5

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

With no annotations, the description must carry the behavioral load. It correctly discloses that this is a remote cloud-lab execution that uploads artifacts and requires authenticated gcloud, which is valuable context. It omits whether the call blocks until the matrix finishes, whether it returns a run ID for later retrieval via adb_farm_results/adb_farm_matrix, and what happens to uploaded APKs.

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?

Three short sentences, front-loaded with the action and then the mechanism and prerequisite; no filler or restatement of the tool name. It could be marginally tighter by folding the prerequisite into the first sentence, but every sentence earns its place.

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?

For a 7-parameter remote-execution tool with no annotations and no output schema, the definition covers what is run and what credentials are needed but leaves the result lifecycle underspecified. An agent cannot tell from this description how to fetch results afterward or how long a run may take, both of which matter for a cloud matrix job.

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 every parameter including devices syntax, timeout vs execTimeoutMs distinction, and testTargets is already documented in the schema. The description only restates that device models and API levels are configurable, adding no meaning beyond the structured fields, so the baseline of 3 applies.

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?

"Run tests on Firebase Test Lab" names a specific verb and resource, and the follow-up sentence clarifies the mechanism (upload app APK + test APK, execute instrumented tests across device models and API levels). This distinguishes it from local-execution siblings like adb_shell or adb_ci_run_tests, though it never names an alternative explicitly.

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 gives a real prerequisite (gcloud CLI authenticated against a Firebase project), which is the main barrier to using this tool. It does not say when to prefer it over sibling runners such as adb_ci_run_tests, adb_multi_test, or adb_test_session_start, so selection between them is left to inference.

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

Deploy Server

Other Tools