Skip to main content
Glama

adb_gradle

Run Gradle tasks like assembleDebug, installDebug, or clean in an Android project directory, with configurable arguments and timeout for large multi-module builds.

Instructions

Run a Gradle task in an Android project directory

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": {
      "projectPath": "<projectPath>",
      "task": "<task>"
    },
    "name": "adb_gradle"
  }
}

Input Schema

NameRequiredDescriptionDefault
argsNoAdditional Gradle arguments as an array of strings (e.g., ['-Pversion=1.0', '--info']). Use an array — not a space-separated string — so arguments containing quoted values are preserved as single tokens.
taskYesGradle task (e.g., 'assembleDebug', 'installDebug', 'clean')
timeoutNoBuild timeout in milliseconds (30s-30min, default 5min). V5 fix: large multi-module Android projects (60+ modules) routinely exceed the default; raise this for clean builds of bigger projects.
projectPathYesPath to the Android project root (containing gradlew)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv1.1.6
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
  2. Changed5 schema fields changedv1.1.3
    • removedInput schema / additionalProperties
      Removed value: -false
    • changedInput schema / properties / args / description
      Previous value: -"Additional Gradle arguments"New value: +"Additional Gradle arguments as an array of strings (e.g., ['-Pversion=1.0', '--info']). Use an array — not a space-separated string — so arguments containing quoted values are preserved as single tokens."
    • addedInput schema / properties / args / items
      Added value: +{
      +  "type": "string"
      +}
    • changedInput schema / properties / args / type
      Previous value: -"string"New value: +"array"
    • addedInput schema / properties / timeout
      Added value: +{
      +  "default": 300000,
      +  "description": "Build timeout in milliseconds (30s-30min, default 5min). V5 fix: large multi-module Android projects (60+ modules) routinely exceed the default; raise this for clean builds of bigger projects.",
      +  "maximum": 1800000,
      +  "minimum": 30000,
      +  "type": "integer"
      +}
  3. First observedv1.1.1

TDQS

C2.9/5.0
Behavior2/5

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

With no annotations, the description carries the full behavioral burden, yet it discloses nothing about the fact that this is a long-running, potentially destructive build operation (timeout parameter implies it, but that lives in the schema). It does not say whether output is streamed or returned, whether failures surface as errors, or whether APKs/artifacts are written to disk.

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 zero filler. It is efficient, though its brevity borders on under-specification for a build-execution tool with four parameters and no annotations.

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 a long-running build tool with no annotations and no output schema, the description is too thin: it does not state what the call returns, how to interpret build failures, or that the project root must contain gradlew (only the schema says that). The single sentence leaves significant gaps an agent would need to call it confidently.

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 the schema already explains projectPath, task, args, and timeout, including the rationale for array-form args and the timeout range. The description adds no semantics beyond that, which is the expected baseline when the schema does the heavy lifting.

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?

States a specific verb ('Run') and resource ('Gradle task') with a clear scope ('in an Android project directory'). However, it does not distinguish itself from the sibling adb_build_and_install, which plausibly wraps a similar Gradle invocation, leaving the agent to guess which one to pick.

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?

No when-to-use guidance at all: nothing says whether to prefer this over adb_build_and_install, whether the project must already be configured, or whether it targets a connected device. The agent must infer all routing from the name alone.

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

Deploy Server

Other Tools