Skip to main content
Glama

Run Gradle Build

gradle_build
Idempotent

Run a Gradle build for an Android project, with debug/release variants and optional module targeting, to verify compilation before testing or deployment.

Instructions

Run a Gradle build for an Android project. Supports debug/release variants and optional module targeting

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

Input Schema

NameRequiredDescriptionDefault
moduleNoSpecific module to build, e.g. ':app'. Omit for root project
variantNoBuild variantdebug
projectDirYesAbsolute path to the Android project root directory
stacktraceNoInclude full stacktrace on error

Output Schema

NameRequiredDescriptionDefault
successYes
exitCodeYes
truncatedNo

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 declare readOnlyHint=false, idempotentHint=true, destructiveHint=false and openWorldHint=true, so the safety profile is covered elsewhere. The description adds no behavior beyond that: it does not mention that the build writes artifacts to disk, how long builds may run, what happens on failure/partial builds, or whether a clean state is required, which matters for an open-world idempotent-but-mutating operation.

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?

Two short sentences, front-loaded with the core action, with no filler or repetition. It is efficient, though it spends its second sentence restating what the schema already labels.

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

Completeness3/5

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

An output schema exists and all four parameters are fully described in the schema, so the description need not explain return values or parameter formats. What remains missing is the one thing only the description can supply: how this build tool relates to the other Gradle siblings and what its execution side effects are.

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 projectDir, module, variant and stacktrace are all documented with examples and defaults in the schema itself. The description only echoes variant and module support without adding format, effect, or default semantics, which meets the baseline for fully documented schemas.

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?

The description names a specific verb and resource ('Run a Gradle build') and scopes it to an Android project, plus flags variant and module support. It does not differentiate this from siblings such as gradle_task, gradle_clean, or gradle_list_tasks, so an agent must infer that this is the full-assembly entry point.

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 explicit when-to-use guidance: nothing says when to reach for gradle_build versus gradle_task, gradle_clean, or gradle_dependencies. The only guidance-like content ('Supports debug/release variants and optional module targeting') is capability restatement, not routing or preconditions.

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