hermosodocs

create_meta_ad_rule

Create a Meta automated rule (created switched OFF)

Area: AUTOMATED AD RULES · Ad campaign management. Generated from the running MCP server, like the rest of the tool reference.

Description

AUTOMATED RULES ON META — a standing instruction META runs on the user's ad account on its own schedule, with nobody watching: "pause any ad set whose cost per result is over $X today", "raise the budget 20% when ROAS is above 3, at most once a day, never above $200". Meta runs these rules itself (Ads Manager > Automated rules shows them too). EVERY RULE IS CREATED SWITCHED OFF and read back from Meta to prove it; switching it on is a separate act (set_meta_ad_rule_status). Actions: pause, enable, notify, or change a budget/bid by a percent or amount. A rule that RAISES needs a limit (the ceiling), and the reply says plainly what it will be able to do unattended. Money values are in the account currency's BASE UNIT (for USD 1000 = $10.00), as Meta defines them. Conditions take any Meta rule filter field; for anything the plain fields cannot say, pass Meta's raw evaluationSpec / executionSpec / scheduleSpec. Free.

Parameters

ParameterTypeDescription
adAccountIdrequiredstringMeta ad account id (act_… or the bare number) from list_meta_ads; required — every rule lives on one ad account
namerequiredstringthe rule's name in Ads Manager
scopeobjectwhat the rule looks at: level or ids (Meta requires one)
scope.level"campaign" | "adset" | "ad"campaign, adset or ad: every object at that level, INCLUDING ones created later (Meta re-resolves it each run)
scope.idsstring[]a FIXED list of campaign, ad set or ad ids instead of a level
scope.campaignIdsstring[]only objects under these campaigns
scope.adsetIdsstring[]only ads under these ad sets
scope.nameContainsstringonly objects whose name contains this
scope.statusesstring[]effective_status values, e.g. ["ACTIVE"]
conditionsobject[]when it acts (all must hold)
conditions[].fieldstringany Meta rule filter field, as Meta spells it: spent, cost_per, cpa, cpc, cpm, ctr, results, impressions, frequency, website_purchase_roas, mobile_app_purchase_roas, cost_per_purchase_fb, cost_per_lead_fb, today_spent, yesterday_spent, lifetime_spent, daily_budget, hours_since_creation …
conditions[].operatorstringGREATER_THAN, LESS_THAN, EQUAL, NOT_EQUAL, IN_RANGE, NOT_IN_RANGE, IN, NOT_IN, CONTAIN, NOT_CONTAIN
conditions[].valuestring | number | string | number[]a number, or [low, high] for IN_RANGE. MONEY IS IN THE CURRENCY BASE UNIT: for USD 1000 = $10.00
windowstringtime window for the metrics: TODAY, YESTERDAY, LAST_3_DAYS, LAST_7_DAYS, LAST_14_DAYS, LAST_30_DAYS, LIFETIME, THIS_MONTH …
attributionWindowstringMeta attribution_window value, optional
actionobjectwhat it does
action.type"pause" | "enable" | "notify" | "budget" | "bid"pause, enable (switch back on), notify, budget or bid
action.change"increase" | "decrease"increase or decrease, for budget/bid. Meta has no "set to"
action.byobjectexactly one of percent or amount
action.by.percentnumber
action.by.amountnumberin the currency base unit (cents for USD)
action.limitnumber | number[]REQUIRED for an increase: the ceiling (base unit, 5000 = $50.00). A floor for a decrease. [low, high] with targetField
action.targetFieldstringscale the budget/bid toward a target metric instead (Meta's target_field), e.g. cost_per_result
action.targetnumberthe target value for targetField
action.minMinutesBetweennumberMeta's action_frequency: minutes before the same object is changed again; default 1440 (once a day)
action.maxTimesnumberthe most times this action may run in all (execution_count_limit)
action.levelstringcampaign for a campaign budget (CBO); otherwise the ad set budget
action.userIdsstring[]Meta user ids to notify; default is the connection's user
scheduleobjecthow often Meta checks it (schedule rules)
schedule.type"DAILY" | "HOURLY" | "SEMI_HOURLY" | "CUSTOM"DAILY, HOURLY, SEMI_HOURLY or CUSTOM
schedule.timesobject[]for CUSTOM
schedule.times[].startMinutenumberminutes after midnight, account time, multiple of 30
schedule.times[].endMinutenumber
schedule.times[].daysnumber[]0 = Sunday … 6 = Saturday
triggerobjectmakes it a TRIGGER rule Meta checks in real time (no schedule; pause/enable/notify only)
trigger.typestringMETADATA_CREATION, METADATA_UPDATE, STATS_CHANGE, STATS_MILESTONE or DELIVERY_INSIGHTS_CHANGE
trigger.fieldstring
trigger.valuestring | number | boolean | string | number[]
trigger.operatorstring
evaluationSpecobjectadvanced: Meta's raw evaluation_spec, passed through as given (overrides the plain fields)
executionSpecobjectadvanced: Meta's raw execution_spec, passed through as given (overrides the plain fields)
scheduleSpecobjectadvanced: Meta's raw schedule_spec, passed through as given (overrides the plain fields)

Example call

Every required parameter is shown, filled from the schema where it gives a value and otherwise with a placeholder naming the type. Replace the placeholders with real values. The same call works on the MCP server, the CLI and POST https://app.hermoso.ai/v1/tools/create_meta_ad_rule.

MCP (tools/call)

{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"create_meta_ad_rule","arguments":{"adAccountId":"<string>","name":"<string>"}}}

CLI

hermoso call create_meta_ad_rule --json '{"adAccountId":"<string>","name":"<string>"}'

Credits

Credits are spent only on two things: running an AI model (image, video, voice, text, planning, post-production) and Ad Spy research. See Credits & costs.

All 759 Ad campaign management tools · tools.json