Skip to main content
Glama

cancel_agent_run

Cancels an open (Ready or Working) agent run: a Ready run is no longer offered to runners, and the runner working on a Working run sees it is no longer Working and stops. Cancelling also unlocks the issue for editing. Returns false when the run had already finished or was cancelled. Requires canEdit on the issue.

Input Schema

NameRequiredDescriptionDefault
runIdYesThe run's id, from list_agent_runs or get_issue's latestAgentRun.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.5/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does well: it discloses the external effects on runners, the side effect of unlocking the issue for editing, the permission requirement (canEdit), and the false return on no-op. It stops short of stating whether a cancelled run can be restarted or what happens to the run record afterwards.

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?

Four tightly packed sentences, front-loaded with the action and its state scope, followed by effects, return semantics, and permission. No filler or repetition.

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?

No output schema exists, and the description covers the return value (false on already-finished/cancelled), the permission prerequisite, and the state preconditions. That is everything needed to invoke it correctly.

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?

Only one parameter with 100% schema coverage, and the schema already says where to obtain runId (list_agent_runs or get_issue's latestAgentRun). The description adds value by implying the run must be in an open state for the id to be actionable, though it does not restate the id's origin.

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 ('Cancels ... an agent run') and immediately scopes it to open runs in the Ready or Working state, which distinguishes it cleanly from siblings like finish_agent_run or claim_agent_run. An agent can tell what this does and when it applies 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 clear context: only applies to open (Ready/Working) runs, requires canEdit on the issue, and returns false if the run already finished or was cancelled. It does not explicitly name the sibling alternative (finish_agent_run) for the completed case, so routing is implied rather than stated.

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.