Skip to main content
Glama

rollback_workflow

Revert a workflow to an earlier version by specifying the workflow ID and target version. Use this tool to restore previous configurations when needed.

Instructions

Rollback a workflow to a previous version

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
workflow_idYes
target_versionYes
reasonNo

Implementation Reference

  • Main handler function for rollback_workflow tool. Parses input using RollbackWorkflowSchema, validates existence of current and target workflow versions via storage, executes rollback, and returns formatted success response with details including previous and new versions.
    private async rollbackWorkflow(args: unknown) {
      const parsed = RollbackWorkflowSchema.parse(args);
      
      const workflow = await this.storage.get(parsed.workflow_id);
      if (!workflow) {
        throw new Error(`Workflow not found: ${parsed.workflow_id}`);
      }
      
      const targetWorkflow = await this.storage.getVersion(parsed.workflow_id, parsed.target_version);
      if (!targetWorkflow) {
        throw new Error(`Version ${parsed.target_version} not found for workflow ${parsed.workflow_id}`);
      }
      
      const success = await this.storage.rollback(parsed.workflow_id, parsed.target_version);
      if (!success) {
        throw new Error('Rollback failed');
      }
      
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify({
              success: true,
              workflow_id: parsed.workflow_id,
              workflow_name: workflow.name,
              previous_version: workflow.version,
              rolled_back_to: parsed.target_version,
              reason: parsed.reason || 'No reason provided',
              message: `Successfully rolled back "${workflow.name}" from v${workflow.version} to v${parsed.target_version}`,
            }, null, 2),
          },
        ],
      };
    }
  • Zod schema defining the input structure for rollback_workflow: workflow_id (string, required), target_version (string, required), reason (string, optional).
    const RollbackWorkflowSchema = z.object({
      workflow_id: z.string(),
      target_version: z.string(),
      reason: z.string().optional(),
    });
  • src/index.ts:301-305 (registration)
    Tool registration in getTools() method, defining the rollback_workflow tool's name, description, and converting the Zod schema to JSON schema for MCP protocol compliance.
    {
      name: 'rollback_workflow',
      description: 'Rollback a workflow to a previous version',
      inputSchema: zodToJsonSchema(RollbackWorkflowSchema),
    },
  • src/index.ts:138-139 (registration)
    Dispatch case in the main CallToolRequestSchema handler that routes rollback_workflow calls to the specific rollbackWorkflow method.
    case 'rollback_workflow':
      return await this.rollbackWorkflow(args);
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the action ('rollback') but doesn't explain critical aspects like whether this requires admin permissions, if it's destructive to current workflow data, what happens to running instances, or if there are rate limits. This leaves significant gaps for an agent to understand the tool's behavior safely.

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 front-loads the core action without unnecessary words. It earns its place by clearly stating the tool's purpose, though it could benefit from additional context given the complexity of the operation.

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 complexity of a rollback operation (potentially destructive), no annotations, no output schema, and low schema coverage, the description is incomplete. It lacks details on prerequisites, side effects, error handling, or return values, making it inadequate for safe and effective use by an agent.

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 by explaining parameters, but it adds no meaning beyond what the schema provides. The three parameters (workflow_id, target_version, reason) are undocumented in both schema and description, leaving their semantics unclear—e.g., what format target_version expects or if reason is optional/logged.

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 ('rollback') and resource ('workflow to a previous version'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'update_workflow' or 'get_workflow_versions', which could have overlapping functionality or be used in similar contexts.

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. For example, it doesn't specify if this should be used after detecting errors, for testing, or as an alternative to updating or deleting workflows. The presence of siblings like 'update_workflow' and 'get_workflow_versions' suggests potential overlap, but no explicit usage context is given.

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/FiveOhhWon/workflows-mcp'

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