Skip to main content
Glama

Cancel message generation

cancel_message_generation
DestructiveIdempotent

Moves a queued, enriching or composing generation to the terminal state canceled with canceled_reason = caller_request. Refund rule: the debit is returned if composition has not started (status is queued or enriching); once composing has started the cancel is accepted but the credits are not returned. Canceling an already canceled generation is idempotent and returns it unchanged. Canceling a succeeded or failed generation is 409 not_cancelable. An expired id is 410 generation_expired.

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_message_generation"
  }
}

Input Schema

NameRequiredDescriptionDefault
idYesThe generation id returned by `POST /api/v1/message-intelligence`.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.4/5.0
Behavior5/5

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

Beyond the annotations, the description discloses the refund rule (credits returned only for queued/enriching, not once composing has started), idempotent behavior for already-canceled generations, and the precise error codes for non-cancelable and expired cases. This is exactly the behavioral context the destructiveHint and idempotentHint flags cannot convey.

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?

The content is dense but front-loaded, leading with the state transition before the refund rule and error cases. Formatting with bolding and backticks is slightly noisy for a machine-read description, but every sentence carries operational meaning.

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 lifecycle-mutation tool with no output schema, the description covers the state transition, the credit consequence, idempotency semantics, and all failure modes an agent could hit. Nothing needed to invoke it correctly or predict its outcome 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 coverage is 100% and the single `id` parameter is already documented as the generation id from the creation endpoint, so the description adds no further parameter-level detail such as format or sourcing. With the schema carrying the parameter burden, a baseline 3 is appropriate.

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 opens with a specific verb and resource ('Moves a queued, enriching or composing generation to the terminal state canceled') and names the exact resulting fields, so the agent knows precisely what the tool does. It is clearly distinguishable from read-oriented siblings like get_message_generation.

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?

Usage is framed through the state machine: it states which statuses are cancelable, that a succeeded/failed generation yields 409, and that an expired id yields 410, which effectively tells the agent when the call will and will not succeed. It does not name sibling tools or alternatives, but for a terminal-state operation there is little ambiguity to resolve.

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