Skip to main content
Glama

cancel_workflow

Cancel a workflow to move it to the terminal CANCELLED state. Use when an approval is rejected or a plan is flagged as unsafe, preventing future execution.

Instructions

[WRITE] Cancel a workflow — move it to the terminal CANCELLED state.

Use this when an approval is REJECTED, a review flags the plan as unsafe, or an operator decides the workflow must never run. A cancelled workflow is dead: run_workflow and approve refuse to execute it. Without this, an approval-rejected PENDING workflow could still be picked up and run.

Cancel only stops FUTURE steps. It does NOT undo already-completed steps — use rollback() to reverse those. Cancel is valid only from a non-terminal state; cancelling an already completed/failed/cancelled workflow returns a teaching error. The cancellation is written to the workflow audit log.

Args: workflow_id: The workflow ID to cancel. reason: Optional human-readable reason (e.g. "approval rejected by on-call"), recorded in the audit log.

Returns: Updated workflow state (state='cancelled', outcome='cancelled'), or an error if the workflow is already terminal.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
workflow_idYes
reasonNo
Behavior5/5

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

Discloses side effects: moves to terminal CANCELLED state, stops future steps, does not undo completed, writes to audit log, returns error if already terminal. Annotations are readOnlyHint=false and destructiveHint=false, which are consistent; description adds far more detail.

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?

Description is thorough but not overly verbose; includes clear sections (Args, Returns). Some repetition could be trimmed, but it's well-organized and front-loaded with the most critical information.

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?

Given no output schema, description provides return format (updated workflow state or error). Also includes necessary context about the tool's effect on workflow lifecycle, making it fully self-contained for an agent.

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

Parameters5/5

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

Schema coverage is 0%, so description must compensate. It fully describes both parameters: workflow_id (the ID to cancel) and reason (optional human-readable reason with example and that it's recorded in audit log). This is excellent guidance.

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?

Description starts with '[WRITE] Cancel a workflow — move it to the terminal CANCELLED state.' Clearly states the verb and resource. Distinguishes from siblings like rollback, run_workflow, and approve by explaining when to use it.

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?

Explicitly states when to use: approval rejected, review flags unsafe, operator decision. Also states when not to use and alternatives: 'Cancel only stops FUTURE steps. It does NOT undo already-completed steps — use rollback() to reverse those.' Also indicates valid only from non-terminal state.

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/zw008/VMware-Pilot'

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