Skip to main content
Glama

List gradle tasks

list_gradle_tasks
Destructive

Discovers available Gradle build, test, and install tasks in an Android project via gradlew tasks; scope to a submodule with a task path like :app:tasks.

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.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "list_gradle_tasks"
  }
}

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.2/5.0
Behavior3/5

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

Annotations already declare openWorldHint=true and destructiveHint=true, so safety signaling is covered. The description adds useful context by disclosing that the call shells out to "gradlew tasks", but it says nothing about the destructive/world-touching implication the annotations flag (Gradle configuration can run build scripts, download dependencies), nor about output shape or latency. Useful but not compensating for the surprising destructiveHint.

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 dense sentences with no filler; the core action comes first and the multi-module caveat follows immediately. Every clause carries information an agent needs.

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, no-output-schema tool, the definition covers purpose, defaults, and the submodule path adequately. The only gap is that an agent gets no hint about what the returned task listing looks like or that the call executes Gradle configuration, which matters given destructiveHint=true.

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 coverage is 100% and both parameters are already well documented in the schema, including the ":app:tasks" example and the root-project default, so the description largely restates it. It adds marginal value by pointing to list_gradle_projects as the source of module names, meeting but not much exceeding the baseline.

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") and even names the underlying command ("gradlew tasks"), plus the intent ("to discover build/test/install targets"). This clearly separates it from siblings like list_gradle_projects, list_gradle_variants, and gradle_build.

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?

Explains the default behavior (root project's own tasks in a multi-module build) and gives the exact alternative for the submodule case, including where to obtain the module name ("from list_gradle_projects"). An agent knows both when the default is sufficient and when to override it.

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