Skip to main content
Glama

run_unit_tests

Run Gradle JVM unit tests on an Android project and return a summary with per-suite timing and failing stack traces. Optionally receive structured JSON.

Instructions

Run Gradle JVM unit tests (default task 'test') in project_dir and return the result summary, including per-suite timing and failing-test stack traces. Note that on an Android project 'test' runs EVERY variant's unit tests (debug and release both); pass task="testDebugUnitTest" (or ":app:testDebugUnitTest" in a multi-module build) to run just one and roughly halve the time. 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.
Behavior3/5

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

With no annotations, the description carries the full burden. It discloses the default task behavior, the fact that on Android it runs all variants, and the return format. However, it does not mention side effects (e.g., whether it modifies files), required permissions, or error behaviors, leaving some gaps.

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?

Two sentences: first defines the core purpose and output, second delivers key usage guidance and optional feature. Every word adds utility, no redundancy. Extremely efficient and front-loaded.

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 tool with no output schema, the description adequately describes return values (timing and stack traces, optional JSON). It covers all parameters with extra guidance and addresses the common Android variant scenario. Lacks mention of edge cases like missing gradle wrapper or no tests, but these are minor.

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%, establishing a baseline of 3. The description adds significant value by explaining the json parameter effect (structured JSON), providing Android-specific advice for the task parameter, and clarifying the args parameter as extra Gradle arguments. This goes well beyond the schema 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 description clearly states the action ('Run Gradle JVM unit tests'), the resource (default task 'test'), location (project_dir), and what is returned (summary with per-suite timing and failing-test stack traces). It distinguishes from siblings like run_instrumented_tests and gradle_build by specifying JVM unit tests.

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?

The description provides explicit guidance on when to override the default task on Android projects for efficiency (e.g., task='testDebugUnitTest'), giving concrete examples. It implies appropriate contexts for use but does not explicitly contrast with siblings like gradle_build or run_instrumented_tests, leaving slight ambiguity.

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