Skip to main content
Glama

cancel_agent_run

Destructive

Cancel one live AI agent run: the run and its session flip to 'cancelled' and the runner interrupts the in-flight turn within seconds, without pausing the agent itself. Organisation admins only. Use when an agent run is working on something it should not (a closed ticket, a wrong assumption, a runaway investigation). Identify the run by run_id from list_agent_runs; already-finished runs answer with their final status.

Input Schema

NameRequiredDescriptionDefault
run_idYesThe run UUID to cancel.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Adds rich context beyond the destructiveHint=true annotation: the run and session flip to 'cancelled', the runner interrupts the in-flight turn within seconds, the agent itself is not paused, and already-finished runs respond with their final status rather than erroring. This discloses effect, timing, and edge behavior that the annotations alone do not.

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 verb and resource, then effects, then constraints, then usage. Every sentence carries information, though the description is on the denser side; no filler.

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 single-parameter mutation tool with no output schema, the description covers effect, timing, auth requirement, parameter provenance, and finished-run behavior, leaving no material gap for correct invocation.

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?

Schema coverage is 100%, so baseline is 3, but the description adds provenance by telling the agent to source run_id from list_agent_runs. It adds useful meaning without detailing format (the schema already states UUID).

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+resource (cancel one live AI agent run) with clear scope, and the phrase 'AI agent run' distinguishes it from sibling cancellers like cancel_execution, cancel_data_run, and cancel_execution_step. An agent can identify the target without opening the 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?

Gives explicit when-to-use triggers ('an agent run is working on something it should not') and routes the agent to list_agent_runs to obtain run_id, plus notes admin-only restriction and the already-finished-run behavior. It stops short of naming sibling cancellation tools as explicit alternatives, so a 4 rather than 5.

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