Skip to main content
Glama

Cancel run

cancel_run
Destructive

Stop an in-flight agent run asynchronously, returning 'cancelling' status; poll get_run_result until it shows 'cancelled'.

Instructions

Stop an in-flight agent run. Cancellation is asynchronous: a successful call returns status "cancelling"; poll get_run_result until the run becomes "cancelled". A run that already finished cannot be cancelled.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
run_idYesThe run id returned by invoke_agent.
agent_idYesThe agent's UUID.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
runIdYesThe run whose cancellation was requested.
statusYesCancellation request status.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.16.0
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "properties": {
      +    "runId": {
      +      "description": "The run whose cancellation was requested.",
      +      "type": "string"
      +    },
      +    "status": {
      +      "description": "Cancellation request status.",
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "runId",
      +    "status"
      +  ],
      +  "type": "object"
      +}
  2. Addedv0.9.0

TDQS

A4.5/5.0
Behavior5/5

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

Goes well beyond the annotations by disclosing that cancellation is asynchronous, that a successful call returns status 'cancelling', and that the run must be polled until it becomes 'cancelled'. This gives the agent critical expectations about side effects and timing that annotations alone do not convey.

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?

Three concise sentences with no filler. The core purpose is front-loaded, followed by essential async behavior and a practical caveat. Every sentence earns its place.

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 two-parameter tool with a full input schema, output schema, and rich annotations, the description supplies the missing operational knowledge: async cancellation, status transition, and the terminal-state limitation. Nothing essential is missing for correct invocation.

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%, with both run_id and agent_id already described meaningfully in the input schema. The description does not add parameter-level detail, but it does not need to because the schema already handles it. Baseline of 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?

States a specific verb and resource: 'Stop an in-flight agent run.' This clearly distinguishes cancellation from related siblings like invoke_agent or get_run_result. The scope is precise: it targets only runs that are actively in progress.

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?

Provides clear usage context by specifying the operation is for in-flight runs and explicitly warns that finished runs cannot be cancelled. It also instructs the agent to poll get_run_result to observe the final state. However, it does not explicitly name alternative tools for finished runs or other scenarios.

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