Skip to main content
Glama

Cancel agent run

cancel_agent_run
Destructive

Request cancellation of a running background job. Takes effect at its next tool-call round boundary, not instantly.

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

Input Schema

NameRequiredDescriptionDefault
run_idYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

B3/5.0
Behavior3/5

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

The annotations already declare destructiveHint=true, idempotentHint=false and openWorldHint=false, so the safety profile is covered. The description adds one genuinely non-obvious behavioral fact - cancellation only lands at the next tool-call round boundary - but says nothing about what happens to work already produced, whether the request can be withdrawn, or what error surfaces if the run is gone.

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?

Two tight sentences with the primary action first and the timing caveat second; nothing is redundant. It is perhaps too terse given the semantic gaps, but no wording is wasted.

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 single-parameter destructive tool with no output schema, the description covers the action and its timing, which is the core. It leaves out how to obtain run_id and the post-cancellation state, both of which an agent needs to call this correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

One parameter with zero schema description coverage, so the description must carry the burden of explaining run_id, yet it never says where run_id comes from (presumably list_agent_runs) or what form it takes. An agent has to infer the identifier source entirely.

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?

Specific verb (cancel) plus resource (a running background agent run), and the boundary note makes clear it is cooperative rather than a kill switch. It does not explicitly distinguish itself from siblings like inject_run_message or delete_agent, so it stops short of a 5.

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

Usage Guidelines2/5

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

The phrase 'a running background job' implies the precondition but there is no explicit when-to-use or when-not guidance. Nothing tells the agent whether to cancel versus message the run, or what to do when the run has already finished.

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