Skip to main content
Glama

Plan a comment-to-DM automation change

plan_dm_automation_change
Read-only

Use this when the owner wants people who comment a keyword on an Instagram post or reel to get an automatic DM (an auto-reply with a guide, lead magnet, link or booking page, optionally asking them to follow or for their email or phone), or wants to change, rename or retarget one, or the same for replies to their Instagram Story. Not for follow-up emails, which are the follow-up tools. Create or edit a comment-to-DM rule (Instagram comment→DM, NOT an email sequence). Diffs against what is saved, with warnings and how many people are mid-conversation. Saves NOTHING — returns a change_token to pass to apply_dm_automation_change. Omit automation_id to create a new rule. A rule that will be live (new, or switched from paused to active) needs a free slot in the plan's active-automation allowance (get_plan shows how many may be live at once; paused rules are unlimited); save it with is_active: false to stay under it.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "plan_dm_automation_change"
  }
}

Input Schema

NameRequiredDescriptionDefault
nameNo
clientNoClient website slug (or id). Required for platform-scoped keys.
keywordsNoMatched case-insensitively as a whole word or phrase: "guide" matches "Guide please!" and "the guide." but not "guidebook" or "guides". Required when trigger_type is "keyword"; optional for "story_reply" (empty = any reply). At most 10, each up to 40 characters.
platformNoWhich connected account the rule is saved against. Required when creating if the client has both connected. Where it answers comments is `platforms`.
is_activeNo
platformsNoWhere the rule answers comments. A new rule defaults to the platform of the account it is saved against; an edit keeps what the rule already has.
target_modeNo"any" = every post, "specific" = one post (pass target_media_id), "next" = the next post published after saving, "keyword_posts" = posts whose caption names the keyword plus the next post published (the safe default for an established account: nobody under an old post gets a DM they were never offered).
button_labelNoText on the button in the opening DM. Max 20 characters.
trigger_typeNo"any_comment" / "keyword" answer comments on posts. "story_reply" (the console’s "Replies to my Story") answers a reply to ANY of the account’s Instagram Stories instead — with one of `keywords`, or any reply when keywords is empty. Instagram only; it has no post target and no public reply, and the same person gets it at most once a day. The DM flow (gates, delivery, voice note, follow-ups) is the same.
automation_idNoOmit to create a new automation; pass an id to edit an existing one.
call_on_phoneNoREQUIRES require_phone, and only for accounts with AI calling (refused otherwise). About a minute after the delivery DM, the AI caller (get_ai_caller) rings the number they gave — or at 8am their time if it is outside 8am–9pm there — to check they got it, answer questions and offer to book. Every AI-call refusal still applies (no agent or number set up, do-not-call, the daily cap); a refused call is recorded on the conversation and not retried in a loop.
delivery_linkNoAppended to the delivery message on its own line.
require_emailNoAsks the person to type their email before sending the content. Works on both platforms — unlike require_follow this is not a button, it is a typed reply parsed for an address. If both gates are on, follow is asked first, then email.
require_phoneNoAsks the person to type their phone number before sending the content: after their email when require_email is on, or on its own, where the number alone makes them a lead (follow + phone is a whole rule, and the owner is notified to call them). A reply that is not a valid number gets a fixed re-ask until it is. This sentence is always sent under the prompt and cannot be changed or removed: "By sending your number you agree to get texts and calls, including AI-assisted calls, from <business name>. Msg & data rates may apply. Reply STOP to opt out." — the full DM is stored as their consent to texts AND calls, so they can be AI-called later with plan_ai_call whether or not call_on_phone is on. The number lets text steps in the rule's follow-up (social sequence, channel "sms") reach them from the account's texting number; check get_sms_account.
require_followNoAsks the person to follow before sending the content.
opening_messageNoThe first DM, sent as soon as they comment. Carries the button. Up to 1000 characters.
target_media_idNoFrom list_dm_automation_posts. Only used when target_mode is "specific".
voice_note_textNoWhat the voice note says after "Hey <name>,". Written to be HEARD: casual, plain, no greeting or name (added per person), no [tags]. Required when voice_note_enabled is true. Up to 400 characters (about 25 seconds).
delivery_messageNoThe payoff — sent once they qualify. Up to 1000 characters.
voice_note_enabledNoOnly on plans that include voice notes. After the delivery DM, also send a voice note in the voice chosen for the account (Settings, Texting, Your voice): "Hey <their first name>," then voice_note_text. Costs 1 credit per person. Where the plan does not include it, the answer says so.
email_prompt_messageNoSent asking for their email. Required when require_email is true. An invalid reply gets a fixed system re-ask, not this message repeated. Up to 1000 characters.
phone_prompt_messageNoThe ask above the consent sentence. Defaults to "Thanks! What's the best number to reach you at?". Up to 500 characters.
follow_prompt_messageNoSent when they tap and are not following yet. Required when require_follow is true. Up to 1000 characters.
add_to_social_sequenceNoRequires require_email AND social_email_sequence_id. When someone gives a valid email, also save them as a social lead (see list_social_leads — a SEPARATE system from crm_leads/website forms) and enroll them in the chosen email sequence.
comment_reply_messagesNoOptional PUBLIC replies under the comment, e.g. "Check your DMs!". One is picked at random per comment, so several variants avoid looking automated. Up to 5, each up to 300 characters.
social_email_sequence_idNoWhich of the client's named email sequences add_to_social_sequence enrolls them in — an id from list_social_sequences. Required when add_to_social_sequence is true; there is no default to fall back to.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changed
    • changedInput schema / properties / keywords / description
      Previous value: -"Matched case-insensitively as a whole word or phrase: \"guide\" matches \"Guide please!\" and \"the guide.\" but not \"guidebook\" or \"guides\". Required when trigger_type is \"keyword\". At most 10, each up to 40 characters."New value: +"Matched case-insensitively as a whole word or phrase: \"guide\" matches \"Guide please!\" and \"the guide.\" but not \"guidebook\" or \"guides\". Required when trigger_type is \"keyword\"; optional for \"story_reply\" (empty = any reply). At most 10, each up to 40 characters."
    • addedInput schema / properties / trigger_type / description
      Added value: +"\"any_comment\" / \"keyword\" answer comments on posts. \"story_reply\" (the console’s \"Replies to my Story\") answers a reply to ANY of the account’s Instagram Stories instead — with one of `keywords`, or any reply when keywords is empty. Instagram only; it has no post target and no public reply, and the same person gets it at most once a day. The DM flow (gates, delivery, voice note, follow-ups) is the same."
    • changedInput schema / properties / trigger_type / enum
      Previous value: -[
      -  "any_comment",
      -  "keyword"
      -]New value: +[
      +  "any_comment",
      +  "keyword",
      +  "story_reply"
      +]
  2. Changed1 schema field changed
    • changedInput schema / properties / require_phone / description
      Previous value: -"Asks the person to type their phone number after their email, before sending the content; a reply that is not a valid number gets a fixed re-ask until it is. REQUIRES require_email (the number is saved on the contact their email creates). This sentence is always sent under the prompt and cannot be changed or removed: \"By sending your number you agree to get texts and calls, including AI-assisted calls, from <business name>. Msg & data rates may apply. Reply STOP to opt out.\" — the full DM is stored as their consent to texts AND calls, so they can be AI-called later with plan_ai_call whether or not call_on_phone is on. The number lets text steps in the rule's follow-up (social sequence, channel \"sms\") reach them from the account's texting number; check get_sms_account."New value: +"Asks the person to type their phone number before sending the content: after their email when require_email is on, or on its own, where the number alone makes them a lead (follow + phone is a whole rule, and the owner is notified to call them). A reply that is not a valid number gets a fixed re-ask until it is. This sentence is always sent under the prompt and cannot be changed or removed: \"By sending your number you agree to get texts and calls, including AI-assisted calls, from <business name>. Msg & data rates may apply. Reply STOP to opt out.\" — the full DM is stored as their consent to texts AND calls, so they can be AI-called later with plan_ai_call whether or not call_on_phone is on. The number lets text steps in the rule's follow-up (social sequence, channel \"sms\") reach them from the account's texting number; check get_sms_account."
  3. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Annotations only declare readOnlyHint/openWorldHint/destructiveHint; the description goes far beyond them by stating it diffs against saved state with warnings and mid-conversation counts, persists nothing, and returns a change_token. It also discloses a real precondition with a failure mode — a rule that will be live needs a free slot in the active-automation allowance (paused rules unlimited), with the is_active:false workaround — and notes per-person credit costs and the refusal behavior of related features.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

It is front-loaded with a clear "Use this when" and the critical "saves nothing" caveat, but the third sentence ("Create or edit a comment-to-DM rule…") largely restates the opening, and the first sentence is a heavily nested run-on whose clauses are hard to parse. The content mostly earns its place, but the structure could trim the duplication.

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 26-parameter, zero-required planning tool with no output schema, the description covers the essentials: create vs edit, plan-vs-apply lifecycle, plan-limit precondition, and Story-reply scope. It does not say how an agent should obtain an automation_id to retarget (presumably list_dm_automations/get_dm_automation) or what the returned diff/warnings look like, which are minor remaining gaps given the rich schema.

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 description coverage is 92%, so the schema already carries most parameter meaning and the baseline would be 3. The description still adds cross-parameter semantics not present in any single field: the automation_id-omitted/creates distinction and the interaction between is_active and the plan's live-rule allowance, which no individual property description states.

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 uses a specific verb and resource: "Create or edit a comment-to-DM rule (Instagram comment→DM, NOT an email sequence)." It explicitly excludes follow-up email workflows ("Not for follow-up emails, which are the follow-up tools") and, together with the change_token hint, distinguishes itself from apply_dm_automation_change without the agent needing to inspect 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?

The opening sentence covers the exact use case (keyword comment → automatic DM, and Story replies) and the edit variant ("change, rename or retarget one"). It states the create-vs-edit condition ("Omit automation_id to create a new rule") and the plan/apply split ("Saves NOTHING — returns a change_token to pass to apply_dm_automation_change"), so an agent knows both when to call this tool and what to do next.

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