Skip to main content
Glama

create_automation

Create a DM/comment automation. It is created PAUSED; activate it with update_automation(status="active", user_confirmed=true) after the user approves.

Nothing is sent while it is paused. Read it back with get_automation, show the user the exact DM/reply text and which posts it covers, and activate it only once they have said yes. Activation re-runs the plan and conflict checks, so a conflict with another active automation is reported then.

trigger_type: "comment" (fires on comments), "live_comment" (keyword comments made during one of the account's Instagram Lives), "dm" (keyword-matched incoming DMs), "story_reply" (replies to a story), "reel_share" (someone sends a Reel into the account's DMs — see below), or "ai_dm" (every inbound DM gets a Gemini-generated reply from ai_goal/ ai_context — no post/keyword targeting applies to this type, post_target/ post_ids/keywords are ignored).

"reel_share" answers a Reel that someone shares into the account's DMs — the "share this reel to me and I'll send you the guide" mechanic. A shared Reel carries no text, so keywords are ignored. post_target must be "specific" with post_ids holding the Reels' Instagram media ids; "all" and "attach_later" are refused. Each person is answered once per Reel and automation, and the reply is an ordinary DM with the same buttons and follow gate as a keyword DM. A paid-plan feature. Tell the user it only fires for Reels sent as a DM, not for a Reel shared to a Story or a link pasted as text.

Recipients are told they are talking to an AI: the first AI reply in each DM thread carries an automatic AI-assistant notice, sent once per thread as its own message. It cannot be turned off; preview_ai_dm shows it. Inbound DM text is sent to Google Gemini to generate the reply (see reeldrop.io/privacy).

"live_comment" covers every Live the account runs, so post_target/post_ids are ignored; keywords work as for "comment". It sends the private DM only while the Live is running (Instagram refuses a private reply to a Live comment once the broadcast ends), each person is answered once per Live, and it has no public reply or follow-up. Tell the user that, since a Live cannot be tested after the fact. A paid-plan feature.

post_target is required — ask the user, never pick it for them. It says which content this applies to:

  • "all": every reel (feed posts/carousels too, Creator plan only — Free is reel-only for comment automations) for trigger_type "comment", or every story for "story_reply" ("reel_share" does not accept it; use "specific"). Never choose this on the user's behalf: use it only after they have explicitly asked for every reel or story to be covered. For trigger_type "ai_dm", "live_comment" and "ice_breaker", where targeting does not apply, pass "all" — it has no effect there.

  • "specific": post_ids required — Instagram media ids, not this tool's own post_id. Get them from get_reel_analytics/ list_scheduled_posts's ig_media_id field (browse and pick), or resolve_reel_by_link if the user gives you a link directly. Ask the user which reel(s) before calling this — don't guess. For a "story_reply" automation the media id is a story's: call list_live_stories to see the ones up right now. For a story that doesn't exist yet, schedule_story/publish_story's automation_id attaches it instead.

  • "attach_later": no post yet — pass the returned id as schedule_reel's automation_id when you schedule the reel this should apply to. It stays paused after the reel is attached, so activate it (with the user's confirmation) once the reel is scheduled.

public_reply_messages/private_dm_messages are rotated round-robin at send time; leave either empty to skip that action type. Never put a URL in private_dm_messages text — attach it with dm_link_button_url below, so the recipient gets a tappable button instead of a link they must copy. A URL left in the text is refused.

dm_link_button_url turns the DM into a tappable link-button card (Meta's button-template) instead of the URL sitting as plain text in the message — set this whenever the DM's purpose is to hand over a link; don't paste the URL into private_dm_messages as well. Requires https://, and only applies to private_dm_messages (Instagram has no button-template equivalent for public replies).

dm_link_button_label is the button's visible text. Only pass it when the user has literally told you what the button should say. Never derive it from the link — not from the URL, the domain, the page title, the file name, or the brand: leave it unset and the button reads "Click here", which the user can change any time by telling you the wording they want.

dm_buttons is the full form of the DM card's buttons — use it instead of dm_link_button_url when the DM needs more than one link, a PDF button, or a reveal-on-tap product carousel. Each entry is {kind, title, url?, cards?}: kind "link" (a web link), "pdf" (a link to a PDF you first uploaded with get_pdf_upload_url — pass that call's public_url as url), or "cards" (a "reveal the cards" button; tapping it sends cards as a product carousel, url ignored). At most 3 buttons; a carousel holds at most 10 cards. The same label rule applies — never invent a title from a URL. When dm_buttons is given, dm_link_button_url/_label are ignored.

trigger_type="ice_breaker" configures the up-to-4 tappable questions Instagram shows at the top of a brand-new DM thread. Pass them in ice_breakers; keywords/post_target are ignored. Max 4 questions, about 80 characters each. Give each question its own reply with ice_breaker_replies — a list index-aligned with ice_breakers, each entry {messages, dm_buttons} (dm_buttons has the same shape as above; text up to 640 characters). A question with no reply entry, or an empty one, sends the shared private_dm_messages reply instead, so pass private_dm_messages too unless every question has its own reply. Tell the user the three conditions the API cannot check or report on: the buttons render only in the Instagram MOBILE app, only in a thread with no previous messages, and only if the account owner has turned on Settings → Messages and story replies → Message controls → Connected Tools → "Allow access to messages". A successful create means Meta accepted the questions, not that anyone can see them — read ice_breakers_sync_error on the result to check the push itself.

follow_up_enabled/follow_up_delay_seconds/follow_up_message set a second DM, sent once if the person has not replied by then — a nudge, e.g. "Did the link come through?". It needs follow_up_message (an enabled follow-up with no text is never sent) and a delay of 1800–82800 seconds (30 minutes to 23 hours; Instagram refuses a DM more than 24 hours after the person last interacted, so nothing longer can work). It is armed when the first DM is delivered, so it only applies to automations that send a private DM. A paid-plan feature: the reply names the plan when it is not included.

Refuses if this would let two active automations race to send Instagram's one-private-reply-per-comment limit on the same post/ keyword, or (ai_dm) if another ai_dm automation is already active on this account, or (ice_breaker) if another ice_breaker automation already owns this account's questions — Instagram stores one set per account and every write replaces it. Relay the conflict message to the user rather than retrying blindly, it names which existing automation to pause first.

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": {
      "workspace_id": "<workspace_id>",
      "ig_account_id": "<ig_account_id>",
      "name": "<name>",
      "trigger_type": "<trigger_type>",
      "post_target": "<post_target>"
    },
    "name": "create_automation"
  }
}

Input Schema

NameRequiredDescriptionDefault
nameYes
ai_goalNo
ai_linkNo
ai_toneNofriendly
keywordsNo
post_idsNo
ai_contextNo
dm_buttonsNo
post_targetYes
ice_breakersNo
trigger_typeYes
workspace_idYes
ig_account_idYes
keyword_matchNocontains
ask_for_followNo
ai_exit_conditionNo
follow_up_enabledNo
follow_up_messageNo
dm_link_button_urlNo
follow_gate_messageNoHey! Follow us first and I'll send you the link 🙌
ice_breaker_repliesNo
private_dm_messagesNo
dm_link_button_labelNo
public_reply_messagesNo
follow_up_delay_secondsNo

Output Schema

NameRequiredDescriptionDefault
idYes
nameYes
statsNoWhat happened after this automation ran. `dms_failed` is a send that was tried and did not land (dead token, Meta rate limit, policy rejection) — read it next to `events_received` before concluding an automation 'works'.
statusYes
ai_goalYes
ai_linkYes
ai_toneYes
stalledNo
dms_sentYes
keywordsYes
post_idsYes
next_stepYes
ai_contextYes
dm_buttonsNo
post_targetYes
ice_breakersYes
trigger_typeYes
keyword_matchYes
ask_for_followYes
ai_exit_conditionYes
follow_up_enabledNo
follow_up_messageNo
dm_link_button_urlYes
follow_gate_messageYes
ice_breaker_repliesNo
private_dm_messagesYes
public_replies_sentYes
dm_link_button_labelYes
public_reply_messagesYes
follow_up_delay_secondsNo
ice_breakers_sync_errorNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.9/5.0
Behavior5/5

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

Annotations only declare mutating/non-idempotent/open-world; the description goes far beyond them: nothing is sent while paused, activation re-runs plan and conflict checks, specific conflict refusals (one-private-reply-per-comment race, single ai_dm, single ice_breaker set per account), the non-disableable AI notice and Gemini data flow, paid-plan gating, URL-in-text refusal, and hard caps (3 buttons, 10 cards, 4 questions, 1800–82800s follow-up). It also flags what Meta accepts versus what actually renders for ice breakers.

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?

Well front-loaded — the paused-then-activate workflow and the 'ask the user' imperative come first, before the per-type reference material. It is very long and carries some repetition (the 'paid-plan feature' caveat appears three times, reel_share behavior is restated), which costs it a point, but nearly every sentence carries a constraint an agent could otherwise get wrong.

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 25-parameter creation tool with conflicting-constraint logic, the definition covers the full call path from id resolution through creation, activation, and verification (ice_breakers_sync_error on the result). Return values are largely delegated to the output schema, which is appropriate.

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

Parameters5/5

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

With 25 parameters and 0% schema description coverage, the description carries the full burden and mostly does: it defines every trigger_type value, all three post_target modes with prerequisites, round-robin rotation of message arrays, dm_buttons_* vs dm_buttons precedence, ice_breaker_replies index alignment and fallback, and the follow-up delay rationale. Only trivially self-evident fields (name, workspace_id, ig_account_id) and a few AI fields (ai_tone, keyword_match, ask_for_follow) go unmentioned.

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 ('Create a DM/comment automation') and immediately scopes it against the lifecycle siblings: it is created PAUSED and activated later via update_automation. An agent can distinguish this from get_automation/update_automation/duplicate_automation without opening any 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 routing throughout: read back with get_automation, preview with preview_ai_dm, activate with update_automation(status="active", user_confirmed=true) only after approval, resolve media ids via get_reel_analytics/list_scheduled_posts/resolve_reel_by_link, list_live_stories for story targets, schedule_reel's automation_id for attach_later. It also states when NOT to use options ('never pick post_target for them', 'all' refused for reel_share) and which trigger types ignore which params.

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