Skip to main content
Glama

Cancel Agent Run

cancel_agent_run
Destructive

Cancel one run in progress, for example a reply the agent is still working on. Work it handed to other agents is cancelled with it. Take run_id from list_agent_activity or get_agent_task.

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": {
      "agent_id": "<agent_id>",
      "run_id": "<run_id>"
    },
    "name": "cancel_agent_run"
  }
}

Input Schema

NameRequiredDescriptionDefault
noteNoOptional reason, kept with the record.
run_idYes
agent_idYesThe agent id, from list_agents.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A3.7/5.0
Behavior4/5

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

The annotations already declare destructiveHint=true, idempotentHint=false, and readOnlyHint=false, so the safety profile is covered. The description earns credit for adding context the annotations cannot convey: that work delegated to other agents is cancelled alongside the target run, which is a non-obvious cascade effect an agent must know before invoking it. It does not explain what happens when the run has already finished, which matters given the non-idempotent hint.

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 short sentences, zero filler, and the core action plus its side effect are front-loaded before the provenance hint. Every sentence carries distinct information: the action, the cascade consequence, and where to get the identifier.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a destructive, non-idempotent mutation with no output schema, the definition covers the essential action and its cascade effect but omits the outcome: whether cancellation is immediate, what happens to a run that already completed, and whether a second call errors or no-ops. Those gaps are the ones most likely to cause a bad invocation of a destructive tool.

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 67%, with agent_id and note documented inline but run_id undocumented in the schema; the description partially fills that hole by naming the two tools that yield a run_id. However, it adds nothing about the optional note beyond what the schema already says, so the gain over the schema is modest rather than substantial.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

"Cancel one run in progress" gives a specific verb, resource, and a concrete example (a reply the agent is still working on), so the agent knows this operates on a single in-flight run rather than an agent or task. It does not, however, distinguish itself from the sibling stop_agent_task, leaving the boundary between those two cancellation tools implicit.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description does supply a useful precondition for locating the required run_id ("Take run_id from list_agent_activity or get_agent_task"), which is real usage guidance. But it never states when to prefer this over stop_agent_task or run_agent_task_now, nor what condition makes cancellation appropriate versus just letting the run finish, so the when-to-use logic is only implied.

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