Skip to main content
Glama

Gradle build

gradle_build
Destructive

Builds an Android app with Gradle (default assembleDebug) from a project containing gradlew, returning status, errors, log path, and APK paths; supports background jobs for long builds.

Instructions

Build the app with Gradle (default task assembleDebug) in project_dir. project_dir must contain the Gradle wrapper (gradlew). Runs on the host, not a device. Returns a compact summary (status, duration, error count, first errors) and the path of the full log, with credential-shaped values redacted. It also lists the APKs under build/outputs, newest first; that can include APKs left by earlier builds. For builds that take minutes pass background=true: it returns a job id and log path at once, and build_status reports the result and cancel_build stops it.

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": "gradle_build"
  }
}

Input Schema

NameRequiredDescriptionDefault
argsNoExtra arguments passed to Gradle (e.g. --stacktrace, -Pflavor=free).
taskNoGradle task to run. Defaults to assembleDebug.
backgroundNoStart the build detached and return at once with a job id and log path; poll with build_status. Use for builds that take minutes.
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
    • addedInput schema / properties / background
      Added value: +{
      +  "description": "Start the build detached and return at once with a job id and log path; poll with build_status. Use for builds that take minutes.",
      +  "type": "boolean"
      +}
    • 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 run. Defaults to assembleDebug."
  2. First observedv1.0.0

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true and openWorldHint=true, so the safety profile is partly covered; the description still adds real context the annotations cannot: host execution rather than device, the hard gradlew-wrapper prerequisite, credential redaction in output, and the caveat that the APK listing may include artifacts from earlier builds. It does not spell out that a build overwrites/creates files under build/outputs, leaving the destructiveHint unelaborated, so not a 5.

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 action and the wrapper prerequisite, then layers return shape, APK listing, and the background workflow in a sensible order; every sentence carries information. It is dense but not padded, with only minor duplication against the schema text.

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 compensates by describing the returned summary fields (status, duration, error count, first errors) and the full-log path. The remaining gap is failure behavior and how task failures surface, which matters for a build tool of this complexity but is a modest omission.

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 documents task defaults, args examples, background semantics, and the session_set_defaults fallback for project_dir; the description largely restates these rather than adding new parameter meaning. Baseline 3 is appropriate when structured fields carry the parameter burden.

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?

Names a specific verb and resource ("Build the app with Gradle") plus the default task, and immediately scopes it as running "on the host, not a device", which separates it from device-oriented siblings like build_and_run and install_app. An agent can identify the tool's job without opening the schema.

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?

Gives a concrete conditional rule for background=true ("builds that take minutes") and redirects to build_status for polling and cancel_build for stopping, which is exactly the routing an agent needs. It stops short of saying when to prefer this over build_and_run or run_unit_tests, so it is clear context without full alternative coverage.

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