Skip to main content
Glama

Save DM automation

save_dm_automation
Destructive

Creates an Instagram/Facebook DM automation from a flow, or changes one when automationId is given. A flow has triggers (comment on a post, incoming DM, story reply or mention) and an ordered tree of steps (messages, quick-reply questions, link cards, follow check, email and phone number capture, delays, tags, AI agent, public comment reply). The flow is validated like the editor does plus extra checks; errors are returned and nothing is saved. A new automation is saved INACTIVE with the next execution order number, as the editor does; activation is a separate step (set_automation_status). A change replaces the whole flow (the flow as get_automation returns it, edited; steps that keep their ref keep their statistics and the contacts in the middle of the flow) and/or the name and settings; active stays active, inactive stays inactive. A change is refused when the stored automation has parts the flow model cannot represent, unless overwriteUnsupported is true. May first return a confirmation summary and token instead of acting.

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": {
      "brand": "<brand>"
    },
    "name": "save_dm_automation"
  }
}

Input Schema

NameRequiredDescriptionDefault
flowNoThe complete flow. Required when creating; when changing, omit to change only name or settings.
nameNoRequired when creating.
brandYes
automationIdNoId of the automation to change. Omit to create one.
expectedVersionNoChanges only: the version from get_automation. If someone saved in between, the change is refused instead of overwriting.
confirmationTokenNo
applyBusinessHoursNoDelay runs outside the brand's business hours. New automations: false.
mediaToAddInEditorNoMedia for this flow that no tool can upload ("audio" = voice message). The flow is saved without those steps; the result note names them with the editor link.
triggerOncePerUserNoRun at most once per contact. New automations: false.
overwriteUnsupportedNoChanges only: replace a stored flow that has parts the model cannot represent (listed in notEditableParts). Those parts are lost.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / flow / properties / steps / description
      Previous value: -"Fields by type; branches are step lists, timeouts are {after:{amount,unit},then:[steps]}. sendMessage{message} · sendCommentAnswer{reply,variants} · askQuestion{question,options[{text,then}],onNoReply} · sendLink{linkId,title,subtitle,onClicked,onNotClicked} · waitForReply{keywords,onReply,onReplyWithoutKeyword,onNoReply} · isFollower{initialMessage,followUpMessage,maxAttempts,useButton,buttonLabel,useProfileButton,profileButtonLabel,onFollowed,onNotFollowed} · collectEmail{initialMessage,followUpMessage,maxAttempts,webhookUrl,onEmailProvided,onEmailNotProvided} · collectPhone{initialMessage,followUpMessage,maxAttempts,webhookUrl,onPhoneProvided,onPhoneNotProvided} · singleQuestionSurvey{surveyId,onFilled,onNotFilled} · timeDelay{amount,unit} · triggerAutomation{automationId} · addConversationTag{tag} · sendEmailNotification{recipients} · aiAutoReply{waitForAllMessages} · sharePost{postId} · sendMedia{mediaType,mediaPath} · sendAudio{audioPath} · likeMessage, markAsDone, moveConversationToOpen, moveCommentToDone{}. A branching step is the last in its list. A step that keeps its `ref` keeps its statistics."New value: +"Fields by type; branches are step lists, timeouts are {after:{amount,unit},then:[steps]}. sendMessage{message} · sendCommentAnswer{reply,variants,mediaAssetId} · askQuestion{question,options[{text,then}],onNoReply} · sendLink{linkId,title,subtitle,onClicked,onNotClicked} · waitForReply{keywords,onReply,onReplyWithoutKeyword,onNoReply} · isFollower{initialMessage,followUpMessage,maxAttempts,useButton,buttonLabel,useProfileButton,profileButtonLabel,onFollowed,onNotFollowed} · collectEmail{initialMessage,followUpMessage,maxAttempts,webhookUrl,onEmailProvided,onEmailNotProvided} · collectPhone{initialMessage,followUpMessage,maxAttempts,webhookUrl,onPhoneProvided,onPhoneNotProvided} · singleQuestionSurvey{surveyId,onFilled,onNotFilled} · timeDelay{amount,unit} · triggerAutomation{automationId} · addConversationTag{tag} · sendEmailNotification{recipients} · aiAutoReply{waitForAllMessages} · sharePost{postId} · sendMedia{mediaType,mediaPath,mediaAssetId,mediaAssetIds} · sendAudio{audioPath} · likeMessage, markAsDone, moveConversationToOpen, moveCommentToDone{}. A branching step is the last in its list. A step that keeps its `ref` keeps its statistics."
  2. First observed

TDQS

A4.3/5.0
Behavior3/5

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

Annotations already declare destructiveHint=true and readOnlyHint=false, but the description goes well beyond them: validation failures save nothing, new automations land INACTIVE with the next execution order, changes replace the whole flow while ref-preserved steps keep statistics, and a confirmation-token mode may interpose before acting. The only real gap is what a successful response contains beyond notes about skipped media and notEditableParts.

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?

Front-loaded with the verb, resource and mode switch, then ordered into flow shape, validation, lifecycle, change semantics and the confirmation interposition. It is dense and runs long for a single paragraph, but nearly every clause carries operational meaning rather than restating the name.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a destructive 10-parameter tool with deeply nested objects and no output schema, the description covers validation, side effects, version conflict handling, media limitations and the confirmation handshake. What it omits is the shape of a successful return (identifiers, version, notEditableParts listing), which matters because there is no output schema to fall back on.

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?

Schema coverage is 80%, so the baseline is 3, and the description adds genuine meaning: what expectedVersion protects against, that overwriteUnsupported destroys unrepresentable parts, that mediaToAddInEditor causes those steps to be dropped and named in the result note, and that flow is mandatory on create but optional on change. The nested step/trigger payloads are left largely to the schema's own type-by-type documentation.

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 and resource ('Creates an Instagram/Facebook DM automation from a flow') and immediately disambiguates the create-vs-update mode via 'automationId'. It also carves out activation to the sibling set_automation_status, so an agent can distinguish it from adjacent tools without opening the 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?

Explicit when-to-use rules: omit flow to change only name/settings, activation is a separate step, and changes start from the flow as get_automation returns it. It also states the refusal condition (unsupported stored parts) and the escape hatch (overwriteUnsupported), which is exactly the decision an agent needs.

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