Skip to main content
Glama

cancel_generation

DestructiveIdempotent

Stop a generation that's still running, and ask its provider to stop too. A provider that has already started on it may still finish it, and bill for it; the generation's usage then shows what it used, once the provider reports it.

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": {
      "generation_id": "<generation_id>"
    },
    "name": "cancel_generation"
  }
}

Input Schema

NameRequiredDescriptionDefault
generation_idYesThe generation, from create_generation.

Output Schema

NameRequiredDescriptionDefault
idYes`gen_…`.
errorYesWhy it failed.
modelYesThe model it uses, `author/model`.
usageYesWhat the provider reported using, once it has succeeded, or once a cancelled one's task has ended (none used when the provider stopped it in time).
inputsYesThe assets it was given.
outputYesWhere its files are saved.
paramsYesThe model's parameters it was given, as the model's `params` schema describes them.
promptYesThe prompt it was given, when it was given one.
statusYes`running`, `succeeded`, `failed` or `cancelled`.
outputsYesThe assets it made, once it has succeeded.
providerYesThe provider that served it, once one has.
created_atYesRFC 3339.
project_idYesThe project its assets go in.
updated_atYesRFC 3339: when its status last changed.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.9/5.0
Behavior5/5

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

Annotations already flag destructiveHint=true and idempotentHint=true, but the description goes well beyond them: cancellation is best-effort, the provider may still complete and bill the work, and usage is reconciled later. Those billing and partial-cancellation semantics cannot be inferred from any structured field and materially change an agent's decision to call it.

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?

Front-loaded with the action and scoped in the first clause, then two short caveat clauses. Every sentence earns its place, though the trailing usage-reporting clause is slightly convoluted and could read more directly.

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?

With an output schema present, return values need no explanation, and the description covers the key behavioral risks (best-effort stop, possible billing). It stops short of stating error or already-completed behavior, which would matter for a destructive, idempotent operation.

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?

Only one parameter, and the schema already documents it at 100% coverage with the origin 'from create_generation'. The description adds no further syntax, format, or constraint detail, so the baseline of 3 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?

States a specific verb ('Stop') and resource ('a generation') plus a scope qualifier ('that's still running'), which lets an agent tell it apart from get_generation or create_generation. It does not explicitly contrast with the sibling cancel_export, but the resource is unambiguous.

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

Usage Guidelines3/5

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

Usage is implied by the scope phrase 'still running', so an agent knows to call this only on in-flight work. There is no explicit when-not guidance (e.g., what to do if the generation has already completed) and no named alternatives.

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