Skip to main content
Glama

run_cancel

Cancel a background run started with run_submit. Returns cancellation status, handling already-finished runs gracefully.

Instructions

Cancel a background run started with run_submit.

Idempotent: calling this on a run that is already finished/cleaned reports cancelled: false, state: <its actual terminal state> rather than erroring — matching execute_code's own "no partial result" rule, there is nothing partial to hand back either way.

Propagation depends on the SELECTED PROVIDER (see list_execution_providers' cancel capability). The built-in local provider does not support stopping a run once it has started; that is reported honestly here rather than silently pretended to have worked — the computation keeps running to completion and its result stays available via run_inspect, so bound it in advance with run_submit's own timeout instead. A provider that DOES advertise cancel: true reaches the full spawned process tree the same way execute_code's own cancellation does — RunSupervisor already owns that; this tool only calls it.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
run_idYes
Behavior5/5

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

The description is highly transparent about behavioral outcomes: it discloses that the local provider does not actually stop runs and that the tool honestly reports this, while provider with 'cancel: true' will terminate the process tree. It also clarifies the idempotent response for already-completed runs, leaving no ambiguity about side effects.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is overly verbose, repeating phrases like 'matching execute_code's own rule' and 'that is reported honestly' in a way that adds redundancy. While every sentence contributes meaning, the same information could be conveyed more succinctly. The structure is logical but could be tightened.

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?

The description covers all relevant contexts: the tool's relation to 'run_submit', idempotency behavior, provider-specific cancel capabilities, and the recommended fallback (setting 'timeout' on submission). It even explains the underlying rationale for the local provider's behavior, making it complete for any user deciding whether to use this tool.

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?

The only parameter, 'run_id', is well-named and its purpose is obvious from the tool name and description. Although the schema provides no description, the tool description implicitly defines it as the identifier of the background run to cancel. A brief explicit mention would elevate clarity, but it is not necessary.

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 explicitly states the tool cancels a background run started with 'run_submit', which is a clear and specific verb-resource pairing. It distinguishes this tool from the sibling 'run_inspect' by focusing on cancellation rather than inspection.

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 provides thorough usage guidance, explaining idempotency (calling on already-finished runs reports state instead of erroring), provider-dependent behavior, and the fallback of using 'timeout' with 'run_submit' for the local provider. It also references 'list_execution_providers' for capability details, making the tool's applicability explicit.

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/The-40-Thieves/codecalc'

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