Skip to main content
Glama

cancelWorkflow

Stop a running workflow instance in Adobe Experience Manager by providing the workflow ID and optional reason for cancellation.

Instructions

Cancel a workflow instance

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
workflowIdYes
reasonNo

Implementation Reference

  • MCP tool schema definition for 'cancelWorkflow' including input validation schema with required 'workflowId' and optional 'reason'.
    {
      name: 'cancelWorkflow',
      description: 'Cancel a workflow instance',
      inputSchema: {
        type: 'object',
        properties: {
          workflowId: { type: 'string' },
          reason: { type: 'string' }
        },
        required: ['workflowId'],
      },
    },
  • Primary MCP server handler for the 'cancelWorkflow' tool call. Extracts parameters from args and delegates execution to AEMConnector.cancelWorkflow, formats response as MCP content.
    case 'cancelWorkflow': {
      const { workflowId, reason } = args as { workflowId: string; reason?: string };
      const result = await aemConnector.cancelWorkflow(workflowId, reason);
      return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
    }
  • Core implementation of workflow cancellation in WorkflowOperations class. Performs HTTP POST to AEM's `/etc/workflow/instances/{workflowId}` endpoint with abort action and reason, handles errors and formats success response.
     * Cancel a workflow instance
     */
    async cancelWorkflow(workflowId, reason) {
        return safeExecute(async () => {
            if (!workflowId) {
                throw createAEMError(AEM_ERROR_CODES.INVALID_PARAMETERS, 'Workflow ID is required', { workflowId });
            }
            // Cancel the workflow
            const cancelData = {
                action: 'abort',
                reason: reason || 'Cancelled via AEM MCP Server'
            };
            const response = await this.httpClient.post(`/etc/workflow/instances/${workflowId}`, cancelData, {
                headers: {
                    'Content-Type': 'application/json'
                }
            });
            return createSuccessResponse({
                workflowId,
                reason: cancelData.reason,
                status: 'ABORTED',
                cancelledAt: new Date().toISOString()
            }, 'cancelWorkflow');
        }, 'cancelWorkflow');
    }
  • Delegation method in AEMConnector class that forwards cancelWorkflow call to the specialized WorkflowOperations instance.
    async cancelWorkflow(workflowId: string, reason?: string) {
      return this.workflowOps.cancelWorkflow(workflowId, reason);
  • MCP server registration for listing tools, which includes the 'cancelWorkflow' tool definition from the tools array.
    server.setRequestHandler(ListToolsRequestSchema, async () => {
      return { tools };
    });
Behavior2/5

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

No annotations are provided, so the description carries full burden. It states 'Cancel' implies a destructive/mutative action, but doesn't disclose behavioral traits like whether cancellation is reversible, what permissions are required, if it affects related resources, or what happens to workflow data. For a mutation tool with zero annotation coverage, this is a significant gap in transparency.

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?

The description is a single, efficient sentence with zero wasted words. It is front-loaded with the core action and target, making it immediately understandable. Every word earns its place without redundancy or fluff.

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

Completeness2/5

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

Given the tool's complexity (destructive operation), lack of annotations, no output schema, and 0% schema description coverage, the description is incomplete. It doesn't cover behavioral implications, parameter meanings, or usage context, leaving significant gaps for an AI agent to understand and invoke the tool correctly.

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

Parameters2/5

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

Schema description coverage is 0%, so the description must compensate but adds no parameter information. It doesn't explain what 'workflowId' represents (e.g., format, source) or what 'reason' is used for (e.g., optional note for audit). With 2 undocumented parameters, the description fails to provide necessary semantic context beyond the bare schema.

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 clearly states the action ('Cancel') and target ('a workflow instance'), which is specific and unambiguous. It distinguishes from siblings like 'suspendWorkflow' and 'resumeWorkflow' by indicating termination rather than pausing. However, it doesn't explicitly contrast with these alternatives in the text itself.

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

Usage Guidelines2/5

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

No guidance is provided on when to use this tool versus alternatives like 'suspendWorkflow' or 'resumeWorkflow'. The description lacks context about prerequisites (e.g., workflow must be active) or exclusions (e.g., cannot cancel completed workflows). It merely states what it does without indicating appropriate scenarios.

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/indrasishbanerjee/aem-mcp-server'

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