Skip to main content
Glama

terminate_workflow

Stop a workflow execution and mark it as terminated in the Conductor workflow engine. Provide the workflow ID and optional reason for termination.

Instructions

Terminate a workflow execution. This will stop the workflow and mark it as terminated.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
workflowIdYesThe workflow execution ID to terminate
reasonNoReason for termination

Implementation Reference

  • The handler implementation for the 'terminate_workflow' tool. It extracts workflowId and optional reason from arguments, sends a DELETE request to the Conductor API to terminate the workflow, and returns a success message.
    case "terminate_workflow": {
      const { workflowId, reason = "Terminated via MCP" } = args as any;
      await conductorClient.delete(`/workflow/${workflowId}`, {
        params: { reason },
      });
      
      return {
        content: [
          {
            type: "text",
            text: `Workflow ${workflowId} terminated successfully. Reason: ${reason}`,
          },
        ],
      };
    }
  • The input schema definition for the 'terminate_workflow' tool, specifying required workflowId and optional reason parameters.
      name: "terminate_workflow",
      description:
        "Terminate a workflow execution. This will stop the workflow and mark it as terminated.",
      inputSchema: {
        type: "object",
        properties: {
          workflowId: {
            type: "string",
            description: "The workflow execution ID to terminate",
          },
          reason: {
            type: "string",
            description: "Reason for termination",
          },
        },
        required: ["workflowId"],
      },
    },
  • src/index.ts:308-580 (registration)
    The 'terminate_workflow' tool is registered in the static tools array used by the ListToolsRequestHandler.
        name: "terminate_workflow",
        description:
          "Terminate a workflow execution. This will stop the workflow and mark it as terminated.",
        inputSchema: {
          type: "object",
          properties: {
            workflowId: {
              type: "string",
              description: "The workflow execution ID to terminate",
            },
            reason: {
              type: "string",
              description: "Reason for termination",
            },
          },
          required: ["workflowId"],
        },
      },
      {
        name: "restart_workflow",
        description:
          "Restart a workflow execution from the beginning. This creates a new execution with the same input.",
        inputSchema: {
          type: "object",
          properties: {
            workflowId: {
              type: "string",
              description: "The workflow execution ID to restart",
            },
            useLatestDefinition: {
              type: "boolean",
              description: "Use the latest workflow definition (default: false)",
            },
          },
          required: ["workflowId"],
        },
      },
      {
        name: "retry_workflow",
        description:
          "Retry a failed workflow execution from the last failed task.",
        inputSchema: {
          type: "object",
          properties: {
            workflowId: {
              type: "string",
              description: "The workflow execution ID to retry",
            },
            resumeSubworkflowTasks: {
              type: "boolean",
              description: "Resume subworkflow tasks (default: false)",
            },
          },
          required: ["workflowId"],
        },
      },
      {
        name: "search_workflows",
        description:
          "Advanced search for workflow executions using query syntax. Supports complex queries with multiple criteria.",
        inputSchema: {
          type: "object",
          properties: {
            query: {
              type: "string",
              description: "Query string (e.g., 'workflowType=MyWorkflow AND status=FAILED')",
            },
            start: {
              type: "number",
              description: "Start index for pagination (default: 0)",
            },
            size: {
              type: "number",
              description: "Number of results to return (default: 100)",
            },
            sort: {
              type: "string",
              description: "Sort field and order (e.g., 'startTime:DESC')",
            },
          },
          required: ["query"],
        },
      },
      {
        name: "get_workflow_definition",
        description:
          "Get the definition of a workflow by name and version. Returns the complete workflow definition including all tasks and configuration.",
        inputSchema: {
          type: "object",
          properties: {
            workflowName: {
              type: "string",
              description: "Name of the workflow",
            },
            version: {
              type: "number",
              description: "Version of the workflow (optional, defaults to latest)",
            },
          },
          required: ["workflowName"],
        },
      },
      {
        name: "list_workflow_definitions",
        description:
          "List all registered workflow definitions. Returns metadata about all workflows registered in Conductor.",
        inputSchema: {
          type: "object",
          properties: {
            access: {
              type: "string",
              description: "Filter by access type (READ or CREATE)",
              enum: ["READ", "CREATE"],
            },
            tagKey: {
              type: "string",
              description: "Filter by tag key",
            },
            tagValue: {
              type: "string",
              description: "Filter by tag value",
            },
          },
        },
      },
      {
        name: "create_workflow_definition",
        description:
          "Create or update a workflow definition. If the workflow already exists, it will be updated.",
        inputSchema: {
          type: "object",
          properties: {
            definition: {
              type: "object",
              description: "Complete workflow definition as a JSON object",
            },
            overwrite: {
              type: "boolean",
              description: "Overwrite existing definition (default: true)",
            },
          },
          required: ["definition"],
        },
      },
      {
        name: "get_task_details",
        description:
          "Get details of a specific task execution by task ID. Returns task status, input/output, and execution details.",
        inputSchema: {
          type: "object",
          properties: {
            taskId: {
              type: "string",
              description: "The unique task execution ID",
            },
          },
          required: ["taskId"],
        },
      },
      {
        name: "get_task_logs",
        description:
          "Get execution logs for a specific task. Returns log entries generated during task execution.",
        inputSchema: {
          type: "object",
          properties: {
            taskId: {
              type: "string",
              description: "The unique task execution ID",
            },
          },
          required: ["taskId"],
        },
      },
      {
        name: "update_task_status",
        description:
          "Update the status of a task execution. This is typically used by workers to update task status.",
        inputSchema: {
          type: "object",
          properties: {
            taskId: {
              type: "string",
              description: "The unique task execution ID",
            },
            workflowInstanceId: {
              type: "string",
              description: "The workflow instance ID",
            },
            status: {
              type: "string",
              description: "New task status",
              enum: ["IN_PROGRESS", "FAILED", "FAILED_WITH_TERMINAL_ERROR", "COMPLETED"],
            },
            output: {
              type: "object",
              description: "Task output data",
            },
            logs: {
              type: "array",
              description: "Task execution logs",
              items: {
                type: "object",
              },
            },
          },
          required: ["taskId", "workflowInstanceId", "status"],
        },
      },
      {
        name: "get_task_definition",
        description:
          "Get the definition of a task by name. Returns the task definition including configuration and metadata.",
        inputSchema: {
          type: "object",
          properties: {
            taskName: {
              type: "string",
              description: "Name of the task",
            },
          },
          required: ["taskName"],
        },
      },
      {
        name: "list_task_definitions",
        description:
          "List all registered task definitions. Returns metadata about all tasks registered in Conductor.",
        inputSchema: {
          type: "object",
          properties: {
            access: {
              type: "string",
              description: "Filter by access type (READ or CREATE)",
              enum: ["READ", "CREATE"],
            },
          },
        },
      },
      {
        name: "create_task_definition",
        description:
          "Create or update a task definition. If the task already exists, it will be updated.",
        inputSchema: {
          type: "object",
          properties: {
            definition: {
              type: "object",
              description: "Complete task definition as a JSON object",
            },
          },
          required: ["definition"],
        },
      },
      {
        name: "get_event_handlers",
        description:
          "Get all event handlers or filter by event and active status. Event handlers define how Conductor responds to external events.",
        inputSchema: {
          type: "object",
          properties: {
            event: {
              type: "string",
              description: "Filter by event name",
            },
            activeOnly: {
              type: "boolean",
              description: "Return only active event handlers (default: true)",
            },
          },
        },
      },
    ];
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool stops the workflow and marks it as terminated, which implies a destructive action, but doesn't cover critical aspects like whether termination is reversible, permission requirements, side effects, or error handling. For a mutation tool with zero annotation coverage, this is a significant gap, scoring a 2.

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 that directly states the tool's function without unnecessary words. It is front-loaded with the core action, making it easy to parse. Every part of the sentence earns its place by conveying essential information, resulting in a perfect score of 5.

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 as a destructive operation with no annotations and no output schema, the description is incomplete. It lacks details on behavioral traits, return values, error cases, or usage context. For a tool that terminates workflows, more information is needed to ensure safe and correct usage, leading to a score of 2.

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 has 100% description coverage, with clear documentation for both parameters. The description doesn't add any meaning beyond the schema, such as explaining parameter interactions or providing examples. Since the schema does the heavy lifting, the baseline score of 3 is appropriate, as the description doesn't compensate but also doesn't detract.

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 ('terminate') and resource ('workflow execution'), making the purpose evident. It distinguishes from siblings like 'pause_workflow' or 'restart_workflow' by specifying it stops and marks as terminated, but doesn't explicitly contrast with alternatives like 'cancel_workflow' if present. This is clear but lacks explicit sibling differentiation, warranting a 4.

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?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites, such as needing a running workflow, or compare to other termination-related tools. Without any context on usage scenarios or exclusions, it leaves the agent to infer when this is appropriate, resulting in a score of 2.

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/opensensor/conductor-mcp'

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