Skip to main content
Glama

Sergio by Serviche

Edit a flow's steps

edit_flow_steps
Idempotent

Saves a flow's steps as the Automations editor's save does: send the COMPLETE new step list in order. Add a step by including it, remove one by leaving it out, reorder by changing the order, and edit one by changing its fields. Every step you keep must be sent in full (start from read('flows'), which returns each step's id, timing, channel, message, who it is for and conditions), because the save replaces the whole list; a step you leave out is removed, and at least one step must remain. Copy each step's id so a reorder keeps that step's own autonomy and copy. A step that reaches the client names channel (sms, email or call) and message_template written with Sergio's merge tags, never a hard-coded business or client name. A step's send mode (draft vs automatic) is not set here; its switch stays the owner's. flow_id and the steps come from read('flows'). Pass the same idempotency_key when retrying.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "flow_id": "<flow_id>",
      "steps": "<steps>",
      "idempotency_key": "<idempotency_key>"
    },
    "name": "edit_flow_steps"
  }
}

Input Schema

NameRequiredDescriptionDefault
stepsYes
flow_idYes
idempotency_keyYesYour id for this operation (8-128 of A-Z a-z 0-9 . _ : -). Reuse it on every retry of the same operation; use a new one for a new operation.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / steps / items / properties / message_template / description
      Previous value: -"The exact message a text or email step sends; required for those channels. Message text uses Sergio's merge tags, exactly as spelled: {{Client First Name}} (The recipient's own first name); {{User Company}} (Your business name, exactly as it is set on your organization); {{User First Name}} (The first name of the teammate sending the message (your business profile name when Sergio sends it on its own)); {{Offer}} (This campaign's own offer text, exactly as written on the campaign (e.g. \"$29.89 off next booking\")); {{Offer Expiry Date}} (The day this client has to book by. The same date every step of their sequence quotes); {{Company Phone Number}} (Your primary business phone number, set once in Settings); {{Business Website}} (Your business website, set once in Settings under Business); {{Review Link}} (Your Google review link, set once in Settings and shared by every message that asks for a review); {{Last Visit Date}} (The date of the client's most recent visit. A contact with no past visit is held for you to write); {{Address}} (The recipient's address on file. For a message about a booking, that booking's address); {{pleasantries}} (A short opener in your voice that fits the day the text actually goes out (\"Happy Friday!\" on a Friday, \"Hope your week is going well!\" midweek). Updates on its own if the send time moves. Use it in some messages, not every one); {{Goodwill}} (A closing well-wish in your voice that fits when the text actually goes out (\"Have a great weekend!\" on a Friday afternoon). Updates on its own if the send time moves). Never hard-code the business name or a client name, and never write a bracketed placeholder like [first name]. {{Offer}} needs offer_text set; {{Offer Expiry Date}} needs offer_expiry_days set. The first text automatically ends with \"Reply STOP to opt out.\", so do not write it."New value: +"The exact message a text or email step sends; required for those channels. Message text uses Sergio's merge tags, exactly as spelled: {{Client First Name}} (The recipient's own first name); {{User Company}} (Your business name, exactly as it is set on your organization); {{User First Name}} (The first name of the teammate sending the message (your business profile name when Sergio sends it on its own)); {{Offer}} (This campaign's own offer text, exactly as written on the campaign (e.g. \"$29.89 off next booking\")); {{Offer Expiry Date}} (The day this client has to book by. The same date every step of their sequence quotes); {{Company Phone Number}} (Your primary business phone number, set once in Settings); {{Business Website}} (Your business website, set once in Settings under Business); {{Review Link}} (Your Google review link, set once in Settings and shared by every message that asks for a review); {{Last Visit Date}} (The date of the client's most recent visit. A contact with no past visit is held for you to write); {{Address}} (The recipient's address on file. For a message about a booking, that booking's address); {{pleasantries}} (A short opener in your voice that fits the day the text actually goes out (\"Happy Friday!\" on a Friday, \"Hope your week is going well!\" midweek). Updates on its own if the send time moves. Use it in some messages, not every one); {{Goodwill}} (A closing well-wish in your voice that fits when the text actually goes out (\"Have a great weekend!\" on a Friday afternoon). Updates on its own if the send time moves). Never hard-code the business name or a client name, and never write a bracketed placeholder like [first name]. {{Offer}} needs offer_text set; {{Offer Expiry Date}} needs offer_expiry_days set. The first text automatically ends with the campaign's opt-out line (sms_opt_out_line), so do not write one."
  2. Added

TDQS

A4.3/5.0
Behavior5/5

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

Beyond the annotations, the description discloses that the save replaces the whole list, that omission removes a step, that at least one step must remain, that id preservation carries autonomy and copy, and that send mode is intentionally not set here. It also explains the idempotency contract and merge-tag constraints, which are substantive behavioral details not present in the annotation set.

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?

The description is front-loaded with the core replacement semantics and then layers constraints in a logical order. It is dense but largely earns its length for a complex full-list edit, though some merge-tag guidance overlaps with the schema's message_template description.

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 complex nested edit tool with no output schema, the description covers the critical contract: full-list replacement, removal by omission, minimum step count, idempotency, id preservation, and message-content rules. An agent has enough information to invoke it correctly without needing to infer the destructive replacement behavior.

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

Parameters4/5

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

With only 33% schema description coverage, the description meaningfully compensates by explaining that steps are a complete replacement list sourced from read('flows'), that ids must be copied to preserve per-step autonomy and copy, and that channel/message_template content must use merge tags. It adds less meaning for flow_id beyond its source, and idempotency_key is already well described in the 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 states a specific verb and resource: it saves a flow's steps as a complete list, and it explains add/remove/reorder/edit semantics. It clearly distinguishes full replacement from partial editing, though it does not name sibling tools such as edit_flow or ai_edit_flow that an agent might otherwise consider.

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

Usage Guidelines4/5

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

It gives clear operational guidance: start from read('flows'), send every retained step in full, keep at least one step, copy step ids, and reuse idempotency_key on retries. It does not explicitly say when to prefer this over sibling edit tools or when not to use it, so it stops short of full alternative routing.

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