Skip to main content
Glama

Edit workflow

edit_workflow
DestructiveIdempotent

Apply a batch of constrained edits to a workflow as a new draft version with compare-and-swap, rejecting stale base versions instead of overwriting concurrent work.

Instructions

Apply a batch of constrained edits as one new draft version under base_version compare-and-swap. Supported ops are set_params, add_step, remove_step, and add_router. Read the exact current definition with get_workflow_version first; a stale base_version is rejected instead of overwriting concurrent work. Editing does not activate the draft.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
opsYesOne or more edits applied atomically in order.
workflow_idYesThe workflow's UUID.
base_versionYesThe workflow's current_version; the edit conflicts if it changed.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
versionYesThe new draft version created by the edit.
resolvedNoExternal identifiers resolved while binding the edit.
projectionYesThe value-light projection of the edited workflow definition.
workflow_idYesThe edited workflow.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.16.0
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "properties": {
      +    "projection": {
      +      "description": "The value-light projection of the edited workflow definition."
      +    },
      +    "resolved": {
      +      "description": "External identifiers resolved while binding the edit.",
      +      "items": {
      +        "additionalProperties": false,
      +        "properties": {
      +          "id": {
      +            "type": "string"
      +          },
      +          "note": {
      +            "type": "string"
      +          },
      +          "prop": {
      +            "type": "string"
      +          },
      +          "step": {
      +            "type": "string"
      +          },
      +          "title": {
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "step",
      +          "prop",
      +          "id"
      +        ],
      +        "type": "object"
      +      },
      +      "type": [
      +        "null",
      +        "array"
      +      ]
      +    },
      +    "version": {
      +      "description": "The new draft version created by the edit.",
      +      "maximum": 2147483647,
      +      "minimum": -2147483648,
      +      "type": "integer"
      +    },
      +    "workflow_id": {
      +      "description": "The edited workflow.",
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "workflow_id",
      +    "version",
      +    "projection"
      +  ],
      +  "type": "object"
      +}
  2. Addedv0.9.0

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already indicate destructiveHint=true and idempotentHint=true. The description adds valuable behavioral context: the compare-and-swap versioning, rejection of stale bases, and the fact that the edit creates a draft without activation. These details go beyond the annotation hints and are not redundant.

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?

Three sentences with no filler. The core action is front-loaded, followed by operational guidance (read first, stale rejection, no activation). Every sentence contributes to correct usage.

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?

Covers the key constraints: atomic batch, version conflict handling, prerequisite read, and activation behavior. With a full input schema (100% coverage) and an output schema present, the description provides sufficient context for an agent to call this tool correctly.

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 description coverage is 100%, so the schema already documents all parameters and their purposes. The description adds only minimal extra meaning—confirming supported ops and explaining base_version's compare-and-swap role—but most of this is already present in the schema (e.g., base_version description says 'the edit conflicts if it changed'). Thus, it meets the baseline of 3 without significantly enhancing parameter understanding.

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?

The description clearly states the tool applies a batch of constrained edits as a new draft version, listing the supported ops (set_params, add_step, remove_step, add_router). It distinguishes itself from siblings like create_workflow, delete_agent, and get_workflow by focusing on editing an existing workflow with a compare-and-swap mechanism.

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 instructs the agent to read the current definition with get_workflow_version first, and warns that a stale base_version is rejected. It also clarifies that editing does not activate the draft, setting clear expectations for when to use this tool versus others.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.