Skip to main content
Glama

run_instrumented_tests

Runs Gradle instrumented (on-device) tests against a booted Android device/emulator and returns per-suite timing plus failing-test stack traces, with an optional JSON summary.

Instructions

Run Gradle instrumented (on-device) tests (default task 'connectedAndroidTest') in project_dir — requires a booted device/emulator. Returns per-suite timing and failing-test stack traces; pass json=true for a structured JSON summary. Runs in the foreground and can take minutes; for a long run use gradle_build with task=connectedAndroidTest and background=true, then read the log.

Input Schema

NameRequiredDescriptionDefault
argsNoExtra arguments passed to Gradle (e.g. --stacktrace, -Pflavor=free).
jsonNoFor run_unit_tests/run_instrumented_tests: return the test summary as structured JSON (per-suite timing, full failure stack traces) instead of the human-readable text summary.
taskNoGradle task to run. Defaults to the tool's standard task.
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. Changed1 schema field changedv0.24.3
    • changedInput schema / properties / json / description
      Previous value: -"For run_unit_tests/run_instrumented_tests: return the test summary as structured JSON (per-suite timing, full failure stack traces) instead of the human-readable text summary. Ignored by gradle_build and list_gradle_tasks."New value: +"For run_unit_tests/run_instrumented_tests: return the test summary as structured JSON (per-suite timing, full failure stack traces) instead of the human-readable text summary."
  2. First observedv1.0.0

TDQS

A4.7/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 mostly succeeds: it discloses the foreground/blocking nature, the multi-minute duration, the device precondition, and the return shape (per-suite timing, failure stack traces, JSON option). It stops short of stating side effects an agent might care about, such as the APK being installed on the device or device state being modified.

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?

Front-loaded with the core action and default task, then preconditions, then return behavior, then the long-run escape hatch. Dense but every clause carries information an agent needs; no filler.

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?

For a tool with no annotations and no output schema, the description supplies what those fields would have: device precondition, blocking duration, and the content of the returned summary. Nothing essential for correct invocation is missing.

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 would be 3, but the description adds real value the schema lacks: it names the concrete default task value ('connectedAndroidTest') where the schema only says 'the tool's standard task', and links json=true to the structured summary format.

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 specific verb and resource ('Run Gradle instrumented (on-device) tests') plus the concrete default task 'connectedAndroidTest'. An agent can immediately distinguish it from run_unit_tests (JVM tests) and gradle_build (generic task runner) without inspecting any 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?

Gives an explicit precondition ('requires a booted device/emulator') and a named alternative with the exact parameters to use for long runs ('use gradle_build with task=connectedAndroidTest and background=true, then read the log'). Both when-to-use and when-to-use-something-else are spelled out.

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