Skip to main content
Glama

Patch workflow

patch_workflow

Edit an EXISTING workflow's latest version in place without resending the whole definition. Apply ordered operations (set / remove / replace_in / test) addressed by step name + a dot-path (e.g. step 'generate' path 'llm.system'), passing new code or values as raw JSON — the platform owns the escaping, so you never hand-escape the definition. For a SMALL change to a LARGE value (swap a color, fix a word), use replace_in (find→replace, unique match) so you send a few bytes, not the whole value. For a large NEW value (an embedded HTML page, a long JS block) send it with value_encoding=base64 (or gzip+base64) and a value_sha256 — base64 avoids the escapes/multibyte chars that corrupt in transit, and the sha rejects the op if it was altered anyway, so the write can't silently ship broken. The patched result is statically validated BEFORE it is written: if validation fails, no version is created and the findings are returned (valid=false). On success a NEW version is minted from the latest (an unpublished draft unless publish=true) — so there's no separate preview step: just patch it, then run_workflow / preview the created draft to see it rendered. Use this to change one block; use create_workflow_version for a wholesale rewrite.

Input Schema

NameRequiredDescriptionDefault
slugNothe workflow slug (provide this or workflow_id)
publishNopublish the resulting version immediately (ignored if validation fails)
operationsYesordered edits applied to the LATEST version's definition
workflow_idNothe workflow id (provide this or slug)
expected_content_sha256Nothe content_sha256 from the get_workflow_version you built these operations from. The patch is rejected if the latest version has changed since — nothing is applied and no version is minted. REQUIRED when any path addresses an array element by numeric index (variables[0]), because that is a claim about the definition's current shape whose failure is otherwise SILENT: if an element shifted, the patch edits the wrong one. Optional for self-locating paths — variables[name=css], variables[-] (append), a step addressed by name, or a plain field path — which mean the same thing whatever the definition holds

Output Schema

NameRequiredDescriptionDefault
validYes
createdYes
versionNo
findingsNo
publishedYes
workflow_idNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Annotations only cover the safety profile (readOnly false, destructive false, idempotent false, openWorld true); the description adds substantive behavior beyond them. It discloses that static validation runs BEFORE the write, that a failed validation creates no version and returns findings (valid=false), that a new version is minted from the latest as an unpublished draft unless publish=true, and that base64+sha256 guards against corrupted or altered payloads.

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?

It is long, but front-loaded with the core purpose and every paragraph carries actionable content. There is some redundancy — the corruption rationale for base64 is explained twice — which keeps it just short of a 5.

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?

For a mutation tool with an output schema, the description covers what an agent needs: validation semantics, version-minting behavior, the publish flag, the staleness guard, and how to verify the result (run_workflow / preview the draft). Nothing operational is missing.

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 baseline is 3 and the schema already carries the per-parameter detail. The description's mentions of replace_in, value_encoding=base64/gzip+base64 and value_sha256 largely restate what the schema fields already say, though it does add the decision rationale for choosing between them.

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 first sentence states a specific verb, resource and scope: editing an EXISTING workflow's latest version in place without resending the whole definition. The closing sentence explicitly names the sibling it is not (create_workflow_version for wholesale rewrites), so an agent can route between them without opening either schema.

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?

It gives explicit when-to-use rules with alternatives: replace_in for a small change to a large value, set with base64 for a large new value, create_workflow_version for a rewrite, and patch-then-preview instead of a separate preview step. The publish=true / draft distinction is also spelled out.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources