Skip to main content
Glama

get_coverage_report

Run a JaCoCo Gradle coverage task and summarize line, branch, method, and class percentages with a per-package breakdown, worst-covered first; multi-module reports are merged.

Instructions

Run a JaCoCo coverage-report Gradle task in project_dir (default 'jacocoTestReport') and summarize coverage: overall line/branch/method/class percentages plus a per-package breakdown, worst-covered first; multi-module reports are merged. 'jacocoTestReport' is NOT an Android Gradle plugin task: if it is missing, pass AGP's 'createDebugUnitTestCoverageReport' as task= (find it with list_gradle_tasks; see android://guide/build-and-test). JVM unit tests only. Pass json=true for structured JSON.

Input Schema

NameRequiredDescriptionDefault
argsNoExtra arguments passed to Gradle (e.g. --stacktrace).
jsonNoReturn structured JSON instead of the human-readable text summary.
taskNoGradle task that generates the JaCoCo XML report. Defaults to jacocoTestReport, which is NOT a task the Android Gradle plugin defines — it exists only if the project declares it. If it is missing, check list_gradle_tasks for AGP's built-in "createDebugUnitTestCoverageReport" (present when a build type sets enableUnitTestCoverage = true). Module-qualified names work: ":app:jacocoTestReport".
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.2/5.0
Behavior4/5

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

With no annotations, the description carries the burden and does well: it discloses the default task, the concrete failure mode when that task is absent, an AGP-specific fallback, module-qualified naming, that multi-module reports are merged, and that json=true switches output format. It leaves out cost/duration, whether a build is triggered, and any auth/rate context, keeping it below 5.

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?

Roughly four sentences, front-loaded with the action and return shape, then the AGP caveat, then the scope limit and output flag. Dense but every sentence carries information; the run of clauses makes it slightly heavy to parse.

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?

No output schema exists, and the description fully compensates by describing return content and ordering (percentages, per-package worst-first, merged multi-module). Combined with the no-required-parameter note and session default for project_dir, an agent has everything needed to invoke it correctly.

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 all four parameters (args, json, task, project_dir) are already documented in structured data. The description reinforces the task fallback and json flag but adds little semantics beyond the schema, so the baseline 3 applies.

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?

Names a specific verb and resource ('Run a JaCoCo coverage-report Gradle task') and states exactly what is returned: overall line/branch/method/class percentages plus a per-package breakdown, worst-covered first, with multi-module merging. This clearly separates it from siblings like get_file_coverage (per-file) and run_unit_tests (execution only).

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?

Gives concrete conditional guidance: if 'jacocoTestReport' is missing, use AGP's 'createDebugUnitTestCoverageReport' and locate it via list_gradle_tasks, plus a reference doc. It also scopes usage to JVM unit tests only, implicitly excluding instrumented tests. It stops short of explicitly contrasting with get_file_coverage or run_instrumented_tests, so not a full 5.

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