Skip to main content
Glama

Cancel a queued generation

cancel_generation

Cancel a queued generation before processing starts to get a refund and free the queue slot. If the job is already in progress, it returns an explanation with the current status instead.

Instructions

Cancel a generation that is still WAITING in the queue — its charge is refunded and the queue slot freed. Only works before processing starts: once a worker has picked the job up it cannot be aborted, and this returns an explanation with the current status instead. Costs nothing.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queueIdYesThe queueId from a previous generate_* call.
Behavior5/5

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

The description provides significant behavioral disclosures beyond the annotations: the charge is refunded, the queue slot is freed, the operation only succeeds before processing starts, and if the job has already started it returns an explanation with the current status instead. It also clarifies that calling it costs nothing. These add value beyond the readOnlyHint/idempotentHint/destructiveHint flags.

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?

The description is two sentences, front-loaded with the primary action and outcome. Every clause adds essential information: the waiting state, the refund, the slot release, the timing limitation, and the failure behavior. No wasted words or irrelevant details.

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 tool with no output schema, the description fully covers the operation's behavior in both success and failure cases. It explains the side effects (refund, slot free), the limiting precondition (must be waiting), and the failure response (returns explanation with current status). No gaps are apparent.

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?

The schema description already covers queueId at 100%, stating it comes from a previous generate_* call, which sets a solid baseline. The tool description adds meaning by specifying that the queueId must refer to a generation still WAITING in the queue, and that other states will yield an explanation. This clarifies the parameter's expected provenance and preconditions beyond the schema.

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 clearly states the action (cancel), the resource (a generation in the queue), and the specific state condition (WAITING). It distinguishes this from sibling tools like check_generation (which checks status) and the generate_* tools (which create queued jobs). The title reinforces the purpose.

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 description explicitly states when to use the tool (only before processing starts, while the job is waiting) and when not to (once a worker has picked it up, it cannot be aborted). It does not name an alternative tool, but this is acceptable because no sibling offers cancellation after processing. The refund/cost context also guides usage decisions.

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/2DAICommunity/2dai-mcp-server'

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