Skip to main content
Glama

gradle-build

Execute Gradle build operations for Android applications, generating build summaries with unique identifiers for development workflows.

Instructions

Build. Returns summary with buildId.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
operationYes
moduleNoe.g., ':app'
flavorNo

Implementation Reference

  • Handler function for the gradle-build tool, which performs the build and returns a build summary.
    export async function handleGradleBuildTool(
      input: GradleBuildInput,
      context: ServerContext
    ): Promise<Record<string, unknown>> {
      const { result, fullOutput } = await context.gradle.build(
        input.operation,
        input.module,
        input.flavor
      );
    
      const buildId = context.cache.generateId("build");
      context.cache.set(
        buildId,
        { fullOutput, result, operation: input.operation },
        "build",
        CACHE_TTLS.BUILD_OUTPUT
      );
    
      return {
        buildId,
        summary: {
          success: result.success,
          duration: result.duration,
          warnings: result.warnings,
          errors: result.errors,
          apkPath: result.apkPath,
          tasksExecuted: result.tasksExecuted,
        },
      };
    }
  • Input validation schema for the gradle-build tool.
    export const gradleBuildInputSchema = z.object({
      operation: z.enum(["assembleDebug", "assembleRelease", "bundle"]),
      module: z.string().optional(),
      flavor: z.string().optional(),
    });
  • Definition object for the gradle-build tool.
    export const gradleBuildToolDefinition = {
      name: "gradle-build",
      description: "Build. Returns summary with buildId.",
      inputSchema: {
        type: "object",
        properties: {
          operation: {
            type: "string",
            enum: ["assembleDebug", "assembleRelease", "bundle"],
          },
          module: { type: "string", description: "e.g., ':app'" },
          flavor: { type: "string" },
        },
        required: ["operation"],
      },
      annotations: {
        readOnlyHint: false,
        destructiveHint: false,
        idempotentHint: false,
        openWorldHint: false,
      },
    };
Behavior2/5

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

Without annotations, the description carries full burden but only discloses the return value ('summary with buildId'). It fails to mention critical behavioral traits: this is a write operation creating artifacts, potentially long-running, and requires specific Gradle project context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness2/5

Is the description appropriately sized, front-loaded, and free of redundancy?

While brief (two sentences), this is under-specification rather than efficient conciseness. The first sentence ('Build.') wastes space by stating the obvious; the second lacks detail about what the summary contains.

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

Completeness1/5

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

For a 3-parameter build tool with no annotations and no output schema, the description is inadequate. It omits expected behavior, error conditions, artifact generation details, and parameter relationships necessary for correct invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is low at 33% (only 'module' has an example). The description fails to compensate by explaining the enum values for 'operation' (assembleDebug vs bundle) or the purpose of 'flavor', leaving most parameters semantically undefined.

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

Purpose2/5

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

The description opens with 'Build.' which tautologically restates the tool name 'gradle-build' without specifying the resource (Gradle project/Android app) or distinguishing from siblings like gradle-test. Only the mention of 'buildId' in the return value prevents a score of 1.

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

Usage Guidelines1/5

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

No guidance provided on when to use this tool versus alternatives (e.g., gradle-test for testing), prerequisites (valid Gradle project structure), or expected execution time (builds can be lengthy).

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/thecombatwombat/replicant-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server