Skip to main content
Glama

Cancel a workflow run

workflows_cancel
Destructive

The cancelled run. A run executing a step answers 409, because a step already sent cannot be taken back.

POST /api/v1/workflow-runs/{runId}/cancel

For multi-space accounts, call auth_verify, ask the user which space to use, and pass targetSpaceId. A workflow run can call webhooks and functions and create, change, or delete records. It acts as this key's owner but never beyond this key's permission level. If the key is revoked, expires, or is lowered while a run waits, the run fails instead of carrying on. Cancelling stops the run for good and does not undo steps that already ran. A run executing a step answers 409: try again after it finishes.

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": {
      "runId": "<runId>"
    },
    "name": "workflows_cancel"
  }
}

Input Schema

NameRequiredDescriptionDefault
runIdYes
targetSpaceIdNoBusabase space id. Call auth_verify first and ask the user which space to use when more than one is returned.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A3.7/5.0
Behavior5/5

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

Goes well beyond the destructiveHint=true annotation: it discloses that cancellation is irreversible and does not roll back completed steps, that a run mid-step returns 409 (a retryable conflict, not a hard failure), and that runs act as the key owner but never above the key's permission level and die if the key is revoked or downgraded. That permission-ceiling and revocation behavior is genuinely non-obvious and high-value.

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

Conciseness2/5

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

Structurally poor: it opens with a truncated return-value fragment, embeds a raw HTTP path mid-paragraph, and states the 409 rule twice nearly verbatim. The middle passage about what workflow runs can generally do (webhooks, functions, record mutations) is background about the resource rather than about the cancel action, and dilutes the actionable content.

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

Completeness4/5

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

For a destructive mutation with no output schema, the description covers what an agent needs: irreversibility, the 409 retry condition, space targeting, and permission scoping. Only the runId provenance and a confirmation expectation for such an irreversible action are missing, which keeps it short of a 5.

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 50%: targetSpaceId already documents the auth_verify/multi-space flow in the schema, so the description largely repeats it. It does add value for the undocumented runId by exposing the path template POST /api/v1/workflow-runs/{runId}/cancel, but gives no guidance on runId format or where to obtain it (e.g., workflows_list).

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?

The description eventually states a clear verb+resource and precise semantics: "Cancelling stops the run for good and does not undo steps that already ran." However, it never contrasts the tool against siblings like workflows_decide or workflows_start, and the very first sentence ("The cancelled run.") is a stranded response fragment that obscures rather than announces the purpose.

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?

It gives concrete operational routing: for multi-space accounts call auth_verify, ask the user which space, then pass targetSpaceId; and on a 409 retry after the running step finishes. What it never says is when to choose cancel versus workflows_decide or workflows_start, which is the primary selection decision an agent faces.

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.