Skip to main content
Glama

Cancel a batch

cancel_batch
Destructive

Stop a running batch: the task running now is cancelled and the tasks not started yet are skipped (never run, never charged). Tasks that already ended keep their results and cost.

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

Input Schema

NameRequiredDescriptionDefault
idYesThe batch (bat_…).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.1/5.0
Behavior5/5

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

Annotations declare destructiveHint=true, and the description goes well beyond that by specifying the blast radius per task state: the current task is cancelled, unstarted tasks are never run and never charged, and already-ended tasks keep results and cost. This is exactly the information an agent needs before invoking a destructive operation, and it is not derivable from the annotations.

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?

Two sentences, zero filler, with the action front-loaded and the consequences ordered by task lifecycle state. Every clause carries distinct meaning; nothing repeats the title or schema.

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?

For a one-parameter destructive tool with annotations covering the safety profile and no output schema, the definition covers the important unknown: what happens to each category of task. It leaves minor gaps such as whether the call is synchronous, what an already-finished batch returns, or any permission requirements.

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 coverage is 100% and the single 'id' parameter is already documented as 'The batch (bat_…)' with length bounds. The description adds no format or validation detail beyond that, so the baseline 3 for a fully-covered schema applies.

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?

Opens with a specific verb+resource: 'Stop a running batch', which is distinct from the job-level siblings (cancel_job, get_batch, run_batch) by naming the batch resource and its running state. It never explicitly contrasts itself with cancel_job, so sibling differentiation rests on the resource noun alone.

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?

The phrase 'a running batch' clearly scopes when this applies, and the per-state breakdown tells the caller exactly what the call will do to in-flight, pending, and finished tasks. No explicit exclusion or named alternative is given, so it stops short of full routing guidance.

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.