Skip to main content
Glama

list_gradle_tasks

List available Gradle tasks in a project to discover build, test, and install targets; pass a module-specific task to scope to submodules.

Instructions

List the available Gradle tasks in project_dir (gradlew tasks) — to discover build/test/install targets. In a multi-module build this lists the ROOT project's own tasks by default; pass task=":tasks" (e.g. ":app:tasks", from list_gradle_projects) to scope to a submodule instead.

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. Changed3 schema fields changedv0.24.3
    • removedInput schema / properties / args
      Removed value: -{
      -  "description": "Extra arguments passed to Gradle (e.g. --stacktrace, -Pflavor=free).",
      -  "items": {
      -    "type": "string"
      -  },
      -  "type": [
      -    "null",
      -    "array"
      -  ]
      -}
    • removedInput schema / properties / json
      Removed value: -{
      -  "description": "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.",
      -  "type": "boolean"
      -}
    • changedInput schema / properties / task / description
      Previous value: -"Gradle task to run. Defaults to the tool's standard task."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.0
Behavior3/5

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

With no annotations, the description carries the burden and does disclose key behavior: the underlying command (gradlew tasks) and the multi-module default of listing only the ROOT project's tasks. However, it omits whether running the wrapper may download Gradle or be slow, whether it is strictly read-only, and what happens when project_dir is unset with no pinned default.

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, front-loaded with the action and command, followed by the multi-module caveat and the exact escape hatch. No filler.

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 two-parameter read tool with no output schema, the description covers purpose, the default scoping behavior, and how to target a submodule. It leaves gaps around return format and behavior when no project_dir is provided or pinned.

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 both parameters are already documented in the schema, and the description largely restates the same defaults. It does reinforce the task-param default with a concrete example, but adds little syntax or behavior beyond the schema.

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 available Gradle tasks in project_dir (gradlew tasks)") plus the goal (discover build/test/install targets). This clearly distinguishes it from siblings like gradle_build, list_gradle_variants, and list_gradle_projects.

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?

Explains the purpose context (discovering build/test/install targets) and gives an explicit alternative path: use list_gradle_projects to obtain module names, then pass task="<module>:tasks". It doesn't explicitly say when to prefer list_gradle_variants or gradle_build instead, so it stops short of full when/when-not routing.

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