Create a rule
- Open Rules and select New rule.
- Select the ad accounts and target level.
- Add a target filter, or choose an empty filter to cover the selected level.
- Add a task with at least one action. Add conditions when the action depends on performance.
- For each condition, set the metric, timeframe, operator, and comparison value.
- Choose a recurring schedule or one exact run time, then set the time zone.
- Save as a draft with dry-run mode enabled.
Use custom metrics
Select an active custom metric for the Rule’s ad account and target level. Custom metrics use closed account dates. The Rule checks that every required custom value exists before it selects a task. A missing value cannot pass through anOR condition or a fallback task. An explicit zero is a value.
An import in progress or a failed import does not stop the Rule. The Rule reads current stored values, which can include some corrections from that import. Check the import task and use dry-run mode when you test a new Rule. See Import custom metrics.
Check a dry run
Run the current rule version withdry_run: true. Review which objects match and which actions the rule would take before allowing live changes.
Draft a rule for this account that pauses active ads when spend exceeds 50 today and purchases are zero. Use dry-run mode, show the target filter and schedule, and wait for me to review before activation.Your agent should call
rules_schema for the rule vocabulary and rules_capabilities for the selected account and level. Recorded event availability does not prove that Meta accepts the event for optimization. It should obtain the account ID and ask for any missing targeting or scheduling choices.
Timed actions and duplication
A task can have an empty top-level condition group when you want a scheduled action without metric checks. Through MCP, useschedule.cron for recurring work or schedule.run_at for one exact time with a UTC offset. Choose one mode and supply an IANA time zone.
Duplication rules can copy campaigns, ad sets, or ads. An ad-set rule can use a destination campaign in the same account and creates paused copies. An ad rule requires both destination campaign and ad-set IDs. Check the source level, destination, delivery status, and optional execution limit before activation.
Edit or activate
Read the rule’s current version before changing it.rules_update replaces the definition, so preserve fields you intend to keep.
To allow scheduled live changes, set the rule to Active and turn off Dry run. Review both settings before saving. A manual MCP rules_run defaults to dry-run mode.
Apply shared Guardrails
Enabled Guardrails apply when a rule prepares a provider action. A rule can pass its performance conditions and still receive a guardrail denial. Guardrails check the resolved budget owner, current provider facts, policy limits, and trustedrule action source. They also apply during a dry run. Review the decision before a live run.
Review results
Open the run details or userule_runs_get. Review Activity for decisions and provider actions. rules_delete archives the rule.