Skip to Content
Tool referenceManage automation rule

Manage automation rule (adsap_manage_automation_rule)

Platform: Meta · Read or write: Write · Plan: Early Access · Consumes a task: No · Preview supported: Yes

What it does

Creates, changes, switches on or off, or deletes an automation rule for one ad account. A rule checks the account every day. When every condition is true, it either reports the match or turns the entity off. Ask for a preview first: the copilot reads the parsed rule back to you, including its guardrails, and applies it only after you confirm.

When to use it

  • Use it to set up a daily check that reports, or pauses, campaigns, ad sets or ads that meet your conditions.
  • It supports a preview call, and dry_run defaults to true. Nothing is saved until a second call sends dry_run as false.
  • A new rule needs conditions, min_spend and mode. notify only reports. auto_act turns the entity off.
  • A rule takes 1 to 5 conditions and can be limited to 50 entities with entity_ids. Without entity_ids it watches the whole account.
  • update, enable, disable and delete need a rule_id. To see existing rules and what they did, use adsap_list_automation_rules.
  • Saving a rule calls neither Meta nor Google. The rule is stored in Adsap and checked each day.

Worked example

You ask

“In act_1234567890, pause any ad set whose cost per conversion goes over 40 in the last 3 days, once it has spent 50.”

The assistant calls adsap_manage_automation_rule

{ "action": "create", "account_id": "act_1234567890", "name": "Pause costly ad sets", "level": "ad_set", "conditions": [ { "metric": "cpa", "operator": ">", "value": 40, "timeframe_preset": "last_3_days" } ], "min_spend": 50, "mode": "auto_act", "dry_run": true }

Adsap returns

The field names are the ones Adsap returns. The values are examples.

{ "dry_run": true, "would_create": { "platform": "meta", "ad_account_id": "act_1234567890", "name": "Pause costly ad sets", "level": "ad_set", "scope": { "kind": "account" }, "conditions": [ { "metric": "cpa", "operator": ">", "value": 40, "timeframe_preset": "last_3_days" } ], "min_spend": 50, "cooldown_hours": 24, "exclude_recent_days": 1, "learning_guard": true, "mode": "auto_act", "action": "pause", "enabled": true }, "guardrails": { "min_spend": 50, "cooldown_hours": 24, "ignores_most_recent_days_for_conversion_metrics": 1, "skips_entities_in_learning_or_changed_in_last_48h": true, "acts": true }, "next_step": "Read this back to the user in plain language, including the guardrails, and call again with dry_run false only after they confirm." }

How to read it

This is a preview. Nothing is saved yet. would_create is the rule as Adsap parsed it, with the defaults filled in: cooldown_hours is 24 and scope covers the whole account. guardrails says when the rule holds back. It waits for 50 of spend, ignores the most recent day for conversion metrics, and skips ad sets still in the learning phase. acts is true because mode is auto_act, so a match pauses the ad set.

The assistant reads the rule back to you in plain words. After you confirm, it sends the same call with dry_run set to false. That answer carries created and the new rule_id.

Parameters

Descriptions are shortened from the tool schema. Your assistant sees the full text.

NameTypeRequiredDescription
actionone of create, update, enable, disable, deleteYes
account_idstringYesMeta act_… or bare 10-digit Google Ads customer id.
rule_idstringNoRequired for update, enable, disable and delete.
namestringNo
levelone of campaign, ad_set, adNo
entity_idsarray of stringNoLimit the rule to these specific entities. Omit to watch every entity at that level in the account.
conditionsarray of objectNo
conditions[].metricone of spend, impressions, clicks, conversions, cpa, roas, ctr, link_ctrYescpa = cost per conversion, roas = return on spend, ctr = click rate.
conditions[].operatorone of >, <, >=, <=No
conditions[].valuenumberYes
conditions[].timeframe_presetone of yesterday, last_3_days, last_7_days, last_14_daysNo
min_spendnumberNoRequired on create. The entity must have spent at least this much before the rule may act.
cooldown_hoursintegerNoDefault 24.
modeone of notify, auto_actNo
dry_runbooleanNoPreview only: the request is validated and the resolved payload returned, nothing is created or changed.

Example prompts

  • “Create a rule that pauses any ad set spending more than $100 with zero purchases over 3 days.”
  • “Set up a notify-only rule that flags ads with a cost per lead above 25 EUR after 50 EUR of spend.”
  • “Disable the ‘Kill losers’ rule for now.”

Notes

Every rule needs a minimum spend before it fires, and conditions combine with AND. On Meta a rule never acts on entities still in the learning phase or changed in the last two days. On Google, rules work at the campaign and ad set levels only.

  • adsap_get_recommendations: Verified recommendations AND alerts computed by Adsap’s daily/weekly checks from the client’s own data.
  • adsap_list_automation_rules: List the automation rules on one ad account, and optionally what they have done.

Guide

Read Automation rules for the workflow around this tool, and the Tool reference for every tool.

The Meta Ads MCP server  page shows how to connect Meta Ads to Claude, ChatGPT or Perplexity.

Last updated on