Skip to main content
Glama

Cancel build

cancel_build
Destructive

Stops a background Gradle build using its job ID; cancellation is asynchronous, and the build status later shows the job as failed with a cancellation reason.

Instructions

Stop a background gradle_build by job id. Cancellation is asynchronous: build_status then reports the job as failed, with 'cancelled by cancel_build' as the reason. A job that already finished is reported as such and left alone; an unknown or evicted id is an error.

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": {
      "job_id": "<job_id>"
    },
    "name": "cancel_build"
  }
}

Input Schema

NameRequiredDescriptionDefault
job_idYesJob id returned by gradle_build with background=true.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.25.0

TDQS

A4.5/5.0
Behavior5/5

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

With destructiveHint=true already declared by annotations, the description still adds substantial context: cancellation is asynchronous, the terminal state is reported as failed with a specific reason string, an already-finished job is reported and left alone, and an unknown or evicted id is an error. These are the exact edge cases an agent needs to interpret results correctly.

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

Conciseness5/5

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

Three short sentences, front-loaded with what the tool does, followed by the async outcome and then the edge cases in descending order of likelihood. Every sentence carries distinct information.

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

Completeness5/5

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

For a one-parameter mutation with no output schema, the description covers the async semantics, the resulting observable state, the no-op case, and the error case. Nothing needed to call it or interpret its effect is missing.

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% and the schema already states that job_id comes from gradle_build with background=true. The description repeats 'by job id' but adds no format, validation, or provenance detail beyond the schema; baseline 3 applies.

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?

The description leads with a specific verb and resource: 'Stop a background gradle_build by job id.' It also scopes the operation to background builds, which cleanly separates it from gradle_build (which starts one) and build_status (which observes one) among the siblings.

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?

It gives clear context for when the tool applies (a background job created via gradle_build with background=true) and points to build_status as the way to observe the outcome. It does not say when you should let a build run rather than cancel it, so there is no explicit exclusion.

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