Skip to main content
Glama

Cancel run

cancel_run
Destructive

Stop an in-flight agent run. Cancellation is asynchronous, so poll the run status until it shows cancelled; finished runs cannot be 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.
Behavior5/5

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

Beyond the destructiveHint annotation, the description discloses the asynchronous nature of cancellation, the immediate return status of 'cancelling', the need to poll get_run_result for the final 'cancelled' state, and the limitation that finished runs cannot be cancelled. These are important behavioral traits not present in the annotations.

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 sentences, with the core purpose in the first sentence and supplementary workflow details following. Every sentence contributes meaningful information with no redundancy or 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?

Despite having no output schema, the description compensates by explicitly stating the immediate return status ('cancelling') and the subsequent polling step to reach the final state. The tool's contract is fully described for the agent, including the edge case of finished runs.

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?

The input schema already provides 100% coverage for both parameters (run_id and agent_id), including a note that run_id is from invoke_agent. The description adds no additional semantic meaning or usage detail about the parameters themselves, so the 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?

The description opens with 'Stop an in-flight agent run', which is a specific verb+resource statement that clearly denotes cancellation of an active run. It distinguishes itself from sibling tools like get_run_result (which polls status) and delete_agent (which deletes an agent) by focusing on the run lifecycle.

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

Usage Guidelines5/5

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

The description explicitly states when to use the tool (for in-flight runs) and when not to (for runs that already finished). It also provides an explicit workflow: call cancel_run, then poll get_run_result until status becomes 'cancelled'. This is clear directional guidance with a named alternative for monitoring.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/plori-ai/plori'

If you have feedback or need assistance with the MCP directory API, please join our Discord server