Skip to main content
Glama

Cancel a batch's unfinished jobs

cancel_batch
DestructiveIdempotent

Stops a whole batch: every job still pending or processing becomes cancelled. Cancelled jobs are not charged and are final; a render already under way may finish, but its result is discarded. Jobs that already rendered keep their output and their charge. A finished batch, or a second call, changes nothing. An unknown batchId, or one from another workspace, returns Batch not found. To stop one job and let the rest render, use cancel_job; to render cancelled rows later, create_batch a new batch with them. Needs batches:create on the connection and renders:create in the user's workspace role.

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": {
      "batchId": "<batchId>"
    },
    "name": "cancel_batch"
  }
}

Input Schema

NameRequiredDescriptionDefault
batchIdYesBatch ID returned by create_batch or list_batches

Output Schema

NameRequiredDescriptionDefault
cancelledYesJobs this call cancelled; 0 when they had all finished
stoppedMessagesYesQueued renders removed before they started

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changed
    • removedInput schema / additionalProperties
      Removed value: -false
    • addedInput schema / properties / batchId / pattern
      Added value: +"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
    • addedOutput schema / properties / cancelled / maximum
      Added value: +9007199254740991
    • addedOutput schema / properties / stoppedMessages / maximum
      Added value: +9007199254740991
  2. First observed

TDQS

A4.9/5.0
Behavior5/5

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

Goes well beyond the destructive/idempotent annotations: cancelled jobs are not charged and are final, an in-flight render may finish but its result is discarded, already-rendered jobs keep output and charge. It also documents the 'Batch not found' failure path and the required scopes, none of which the annotations convey.

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?

What happens is front-loaded in the first sentence, followed by effects, idempotency, errors, alternatives, and permissions in a logical order. Dense but every clause carries distinct information; no filler.

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?

Mutation semantics, finality, billing consequences, idempotency, error behavior, sibling routing, and required permissions are all covered; an output schema exists so return values need no explanation. Nothing an agent needs to call this correctly is missing.

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

Parameters4/5

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

Schema coverage is 100%, so the batchId format and origin are already documented. The description still adds meaning the schema lacks: an unknown batchId or one from another workspace fails with 'Batch not found', which tells the agent about cross-workspace scoping of the identifier.

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?

Opens with a specific verb and resource ('Stops a whole batch') and immediately scopes it to unfinished jobs ('every job still pending or processing becomes cancelled'). It is clearly distinguishable from the sibling cancel_job, which is named explicitly later.

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

Usage Guidelines5/5

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

Explicitly routes between alternatives: 'To stop one job and let the rest render, use cancel_job; to render cancelled rows later, create_batch a new batch with them.' It also states when the call is a no-op (finished batch, second call), giving the agent both selection and precondition rules.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources