Skip to main content
Glama

run_instrumented_tests

Run Gradle instrumented on-device tests on a booted device or emulator, returning per-suite timing and failing-test stack traces. Pass json=true for a structured 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 instead of the text form.

Input Schema

TableJSON 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. Ignored by gradle_build and list_gradle_tasks.
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.
Behavior4/5

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

With no annotations provided, the description carries full burden. It discloses that a booted device/emulator is required, that it returns per-suite timing and failing-test stack traces, and that json=true changes output format. It does not mention whether the device must be an emulator or physical, or if there are side effects like app installation. Still, it is fairly transparent for a test runner.

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?

The description is a single sentence with a clarifying second sentence about json output. It is front-loaded and efficient, but the note about default task could be more explicit as 'default task connectedAndroidTest' is already in parentheses.

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?

Given the tool has 4 parameters, no output schema, and no annotations, the description is adequate but not fully complete. It omits details like what happens if no device is available (error message?), whether it installs the app first, or the format of the text summary. For a complex test tool, more behavioral details would improve completeness.

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 the schema already documents all 4 parameters. The description adds no new meaning beyond the schema for parameters like args, project_dir, or task. For json, the description clarifies it is shared with run_unit_tests and ignored by gradle_build/list_gradle_tasks, adding value only for this one parameter. Baseline 3 is appropriate.

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 description clearly states it runs Gradle instrumented (on-device) tests in a project_dir, specifies the default task 'connectedAndroidTest', and distinguishes from other test-running siblings like run_unit_tests by noting the need for a booted device/emulator.

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 explicitly says it requires a booted device/emulator, which is critical context not obvious from the schema. It also hints at an alternative (json=true for structured output) and implicitly distinguishes from run_unit_tests via the device requirement. However, it does not explicitly state when not to use this tool versus build_and_run or gradle_build.

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/iksnerd/adb-mcp'

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