Skip to main content
Glama

Run Gradle Task

gradle_task
Destructive

Run an arbitrary Gradle task in an Android project by specifying the project root, task, and optional arguments.

Instructions

Run an arbitrary Gradle task in an Android project

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "projectDir": "<projectDir>",
      "task": "<task>"
    },
    "name": "gradle_task"
  }
}

Input Schema

NameRequiredDescriptionDefault
argsNoAdditional Gradle arguments, e.g. ['--info', '-Pfoo=bar']
taskYesGradle task to run, e.g. 'test', 'lint', ':app:connectedAndroidTest'
projectDirYesAbsolute path to the Android project root directory

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.1.0

TDQS

C2.9/5.0
Behavior2/5

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

Annotations already flag this as non-read-only, non-idempotent, destructive and open-world, which is the safety-critical information. The description adds nothing on top: no warning that tasks can modify build outputs or source files, no note on runtime, no mention of failure modes or exit-code/Task: prefix conventions. For a destructive arbitrary-execution tool, that is a meaningful 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?

A single front-loaded sentence with no filler or redundancy. It is efficient, though its brevity is the source of the missing guidance rather than a virtue in itself.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For an arbitrary, destructive, open-world execution tool with no output schema, the definition is too thin: it does not say what the agent gets back (output, exit status), whether tasks run with the wrapper, or how failures are surfaced. Complexity is high and the description does not scale to it.

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 three parameters are documented in the schema, including the argument-passing format and path expectations. The description contributes no additional parameter meaning, which meets the baseline-3 bar rather than exceeding it.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

"Run an arbitrary Gradle task in an Android project" gives a specific verb (run) and resource (Gradle task), and the word "arbitrary" implicitly distinguishes it from fixed-purpose siblings like gradle_build, gradle_clean and lint_run. It stops short of naming those siblings explicitly, so an agent must infer the routing itself.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

There is no guidance on when to prefer this general escape hatch over the dedicated gradle_build, gradle_clean, gradle_dependencies or gradle_list_tasks tools, and no stated prerequisites (wrapper present, Gradle daemon, network for dependency resolution). The agent must infer all selection logic.

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