Skip to main content
Glama

cancel_thread

DestructiveIdempotent

Cancel a task: close the thread without its work being done, park it from dispatch with a reason, and end any live claim so the worker's next renew_claim is refused.

Instructions

Cancel a task: close it without its work being done, park it from dispatch with the reason, and end any live claim, so the worker's next renew_claim is refused. The reason (1 to 500 characters) is posted on the thread. Requires workspace:write; without thread:transition only the member that created the thread may cancel it. Cancelling an already-cancelled thread returns the first cancel; a thread closed some other way is refused. The REST twin is POST /threads/{id}/cancel.

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": {
      "thread_id": "<thread_id>",
      "reason": "<reason>"
    },
    "name": "cancel_thread"
  }
}

Input Schema

NameRequiredDescriptionDefault
reasonYeswhy the task is cancelled, posted on the thread
thread_idYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv479.0.0

TDQS

A4.3/5.0
Behavior5/5

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

Annotations already declare destructiveHint=true, idempotentHint=true and readOnlyHint=false, yet the description still adds material behavior beyond them: the reason is publicly posted on the thread, an ended claim causes the worker's next renew_claim to be refused, permissions govern who may cancel, repeated cancels return the first cancel, and otherwise-closed threads are refused. These are exactly the side-effect and error semantics an agent needs before invoking a destructive mutation, and none contradict 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.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The definition is front-loaded with the action and its consequences, then moves to permissions, edge cases, and the REST twin in a logical order. It is dense rather than padded, though 'The reason (1 to 500 characters)' duplicates the schema's minLength/maxLength and could be trimmed.

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 no output schema, the description still covers permissions, idempotent return behavior, refusal conditions, and the REST endpoint, which is close to everything needed to call a destructive two-parameter mutation correctly. The remaining gap is that it never sketches what the returned cancel object looks like, which would help an agent interpret the response of the first versus repeated cancel.

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 50%: reason is documented in the schema, thread_id carries only a uuid format. The description adds that the reason is 1-500 characters and is posted on the thread, which largely restates the schema's own reason description, and it gives thread_id only implicit meaning via 'thread'. Adequate but not compensating much for the undocumented half.

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 gives a specific verb and resource ('Cancel a task') and then enumerates the concrete effects: work is not done, the thread is parked from dispatch with a reason, and any live claim is ended. It also distinguishes the outcome from other closings ('a thread closed some other way is refused'), so an agent can tell it apart from close/cancel variants without opening a schema.

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?

It states the operative conditions clearly: requires workspace:write, and without thread:transition only the creating member may cancel. It also says what happens if the thread is already cancelled or closed another way. It stops short of naming sibling alternatives (e.g. cancel_wait or close_abandoned_thread) as the right choice in other situations, so it is strong context but not a full when/when-not routing guide.

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

Deploy Server

Other Tools