Skip to main content
Glama

list_gradle_variants

Lists buildable Android build variants from Gradle assemble tasks so you can pass the correct task to gradle_build or build_and_run and disambiguate multi-flavor projects.

Instructions

List the buildable build variants in project_dir (parsed from the assemble* tasks) — the Android analogue of "list schemes". Each variant V maps to an assembleV / installV Gradle task; pass it as the task= arg to gradle_build/build_and_run to disambiguate a multi-flavor project. Test-only APK tasks (androidTest/unitTest) are excluded. In a multi-module build the ROOT project usually has no variants of its own (no Android plugin applied there) — pass task=":tasks" (e.g. ":app:tasks", from list_gradle_projects) to scope to the module that actually builds APKs.

Input Schema

NameRequiredDescriptionDefault
taskNoGradle task to scope to, e.g. ":app:tasks" to list the :app module's tasks or variants. Defaults to the root project's tasks.
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 / task / description
      Previous value: -"Gradle task to scope to, e.g. \":app:tasks\" to list variants for the :app module. Defaults to the root project's tasks."New value: +"Gradle task to scope to, e.g. \":app:tasks\" to list the :app module's tasks or variants. Defaults to the root project's tasks."
  2. First observedv1.0.0

TDQS

A4.5/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 well: it discloses how results are derived (assemble* task parsing), what is filtered out (test-only APK tasks), and a significant caveat about multi-module root projects producing nothing. It does not say what happens when gradlew is missing or that invoking this may run Gradle (cost/latency), leaving a modest gap.

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?

Front-loads the core purpose in the first clause, then layers usage and the multi-module caveat. Dense but each sentence carries actionable information; the final multi-module sentence is long yet earns its length by preventing a common empty-result mistake.

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?

No output schema exists, and the description implies the return shape (a list of variant names that map to assembleV/installV tasks) without giving exact field structure or ordering. For a two-parameter read/list tool this is nearly complete; only the precise return format and error conditions are unspecified.

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 baseline would be 3, but the description adds real meaning: it clarifies the relationship between a returned variant V and the task= argument of gradle_build/build_and_run, and explains the module-scoping form of task (e.g. ":app:tasks"). This resolves the ambiguity of a parameter named "task" that actually takes either a task path or a variant name.

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 ("List the buildable build variants in project_dir") plus the derivation mechanism (parsed from assemble* tasks) and an anchoring analogy ("the Android analogue of list schemes"). It also implicitly distinguishes itself from list_gradle_tasks and list_gradle_projects by scoping to variants rather than all tasks or all projects.

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 explicit downstream usage: "pass it as the task= arg to gradle_build/build_and_run to disambiguate a multi-flavor project." It also states an exclusion rule (test-only androidTest/unitTest APK tasks are excluded) and a non-obvious failure mode with the fix — use task="<module>:tasks" from list_gradle_projects when the root project has no variants.

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