Skip to main content
Glama

Create Ad Sets (batch)

adsap_create_ad_sets

Create one or more Meta ad sets under an existing campaign. Supports batch creation (max 20). Ad sets are created PAUSED by default. Detailed targeting: use targeting.flexible_spec groups (OR inside a group, AND between groups, like Ads Manager's Narrow audience) with ids and types from adsap_search_detailed_targeting. Leads campaigns take three destinations: ON_AD (Instant Forms), WEBSITE, and WEBSITE_AND_LEAD_FORM (Website and Instant Forms: OFFSITE_CONVERSIONS + pixel, ads then carry a link and a lead form). Not supported yet (say so and point the user to Meta Ads Manager, never substitute another destination): Messenger and Instagram Direct ad sets, calls, event responses, reminders, shop destinations. WhatsApp ad sets ARE supported: destination_type WHATSAPP with optimization_goal CONVERSATIONS on traffic, engagement, leads or sales campaigns (LINK_CLICKS also works except on leads), plus the page_id of a Facebook Page whose primary WhatsApp number is a WhatsApp Business account; ads in them need no link. ALWAYS call with dry_run: true first: it validates and renders a launch review card where the user confirms, creates (paused) and activates in-card — after it renders, reply with ONE short sentence and stop; do not call the real create from chat unless the user explicitly asks in a new message and the card's activity log shows nothing was created there. Prerequisites: call list_meta_assets for pages/pixels/Instagram accounts, list_pixel_events for conversion events. For App promotion (OUTCOME_APP_PROMOTION) campaigns: each ad set requires promoted_object.application_id + object_store_url, optimization_goal APP_INSTALLS (or OFFSITE_CONVERSIONS with custom_event_type for app-event optimization), and the promoted app must be in Live mode and advertisable by the ad account; OS targeting (user_os) is derived automatically from the store URL. Saved audiences that target specific devices: on a Sales ad set Adsap keeps delivery to those devices; pass reach_more_devices: true only when the user asks for Meta's "Reach more people across other mobile devices".

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": {
      "campaign_id": "<campaign_id>",
      "ad_sets": "<ad_sets>"
    },
    "name": "adsap_create_ad_sets"
  }
}

Input Schema

NameRequiredDescriptionDefault
ad_setsYesArray of ad set definitions. Max 20 per call.
dry_runNoWhen true, validates without creating. Default false.
campaign_idYesParent campaign ID. Call list_campaigns first if needed.
ad_account_idNoTarget ad account. Defaults to user's primary account.
idempotency_keyNoUnique key to prevent duplicate creation from retries.
campaign_objectiveNoParent campaign's objective. Pass it (e.g. from adsap_create_campaign's response) when the campaign was created recently and may not be cached yet. If omitted, resolved from cache; an unresolvable objective fails with guidance.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / ad_sets / items / properties / reach_more_devices
      Added value: +{
      +  "description": "Meta setting \"Reach more people across other mobile devices\". Only applies to a Sales ad set built from a saved audience that targets specific devices or operating systems; ignored everywhere else. Default false: delivery stays on the devices in the saved audience. Set true only when the user asks for it: Meta may then also show the ads on other mobile devices when that is likely to improve performance.",
      +  "type": "boolean"
      +}
  2. Changed4 schema fields changed
    • changedInput schema / properties / ad_sets / items / properties / destination_type / description
      Previous value: -"Where users land after clicking. Default WEBSITE. APP is only valid on OUTCOME_APP_PROMOTION campaigns. ON_AD = instant forms (leads). WEBSITE_AND_LEAD_FORM = Website and Instant Forms (leads only): optimization_goal OFFSITE_CONVERSIONS with pixel_id + conversion_event (usually LEAD); ads on it need BOTH link_url and leadgen_form_id. For engagement: ON_PAGE (page likes), ON_VIDEO (video views), ON_POST (post engagement), INSTAGRAM_PROFILE/FACEBOOK_PAGE/INSTAGRAM_PROFILE_AND_FACEBOOK_PAGE (profile visits). NOT supported by ADSAP yet: messaging destinations (Messenger, WhatsApp, Instagram Direct), calls, event responses, reminders, shop. If the user asks for one of those, say it is not available in ADSAP yet and point them to Meta Ads Manager — never substitute another destination."New value: +"Where users land after clicking. Default WEBSITE. APP is only valid on OUTCOME_APP_PROMOTION campaigns. ON_AD = instant forms (leads). WEBSITE_AND_LEAD_FORM = Website and Instant Forms (leads only): optimization_goal OFFSITE_CONVERSIONS with pixel_id + conversion_event (usually LEAD); ads on it need BOTH link_url and leadgen_form_id. For engagement: ON_PAGE (page likes), ON_VIDEO (video views), ON_POST (post engagement), INSTAGRAM_PROFILE/FACEBOOK_PAGE/INSTAGRAM_PROFILE_AND_FACEBOOK_PAGE (profile visits), WHATSAPP (the ad opens a WhatsApp chat: traffic, engagement, leads and sales campaigns; optimization_goal CONVERSATIONS, or LINK_CLICKS except on leads; page_id of a Facebook Page whose PRIMARY WhatsApp number is a WhatsApp Business account, otherwise Meta refuses the ad set and its message says why, relay it as is; ads in it need no link_url and always carry the Send WhatsApp Message button). NOT supported by ADSAP yet: Messenger and Instagram Direct destinations, calls, event responses, reminders, shop. If the user asks for one of those, say it is not available in ADSAP yet and point them to Meta Ads Manager — never substitute another destination."
    • changedInput schema / properties / ad_sets / items / properties / destination_type / enum
      Previous value: -[
      -  "WEBSITE",
      -  "APP",
      -  "ON_AD",
      -  "WEBSITE_AND_LEAD_FORM",
      -  "ON_PAGE",
      -  "ON_VIDEO",
      -  "ON_POST",
      -  "INSTAGRAM_PROFILE",
      -  "FACEBOOK_PAGE",
      -  "INSTAGRAM_PROFILE_AND_FACEBOOK_PAGE"
      -]New value: +[
      +  "WEBSITE",
      +  "APP",
      +  "ON_AD",
      +  "WEBSITE_AND_LEAD_FORM",
      +  "ON_PAGE",
      +  "ON_VIDEO",
      +  "ON_POST",
      +  "INSTAGRAM_PROFILE",
      +  "FACEBOOK_PAGE",
      +  "INSTAGRAM_PROFILE_AND_FACEBOOK_PAGE",
      +  "WHATSAPP"
      +]
    • changedInput schema / properties / ad_sets / items / properties / optimization_goal / description
      Previous value: -"Optimization goal for ad delivery. PROFILE_VISIT (traffic) / PROFILE_AND_PAGE_ENGAGEMENT (engagement) drive Instagram profile / Facebook Page visits — pair with an INSTAGRAM_PROFILE / FACEBOOK_PAGE / INSTAGRAM_PROFILE_AND_FACEBOOK_PAGE destination_type and a page_id; not available on Special Ad Category campaigns. AD_RECALL_LIFT / TWO_SECOND_CONTINUOUS_VIDEO_VIEWS are Awareness goals (TWO_SECOND also for Engagement + ON_VIDEO). QUALITY_LEAD (conversion leads) is for OUTCOME_LEADS + ON_AD instant forms; Website and Instant Forms (WEBSITE_AND_LEAD_FORM) takes OFFSITE_CONVERSIONS only. POST_ENGAGEMENT needs destination_type ON_POST. Not offered because ADSAP cannot deliver them yet: messaging (CONVERSATIONS), calls, event responses, reminders."New value: +"Optimization goal for ad delivery. PROFILE_VISIT (traffic) / PROFILE_AND_PAGE_ENGAGEMENT (engagement) drive Instagram profile / Facebook Page visits — pair with an INSTAGRAM_PROFILE / FACEBOOK_PAGE / INSTAGRAM_PROFILE_AND_FACEBOOK_PAGE destination_type and a page_id; not available on Special Ad Category campaigns. AD_RECALL_LIFT / TWO_SECOND_CONTINUOUS_VIDEO_VIEWS are Awareness goals (TWO_SECOND also for Engagement + ON_VIDEO). QUALITY_LEAD (conversion leads) is for OUTCOME_LEADS + ON_AD instant forms; Website and Instant Forms (WEBSITE_AND_LEAD_FORM) takes OFFSITE_CONVERSIONS only. POST_ENGAGEMENT needs destination_type ON_POST. CONVERSATIONS (WhatsApp conversations) is only for destination_type WHATSAPP, with a page_id; a WhatsApp ad set takes CONVERSATIONS on traffic, engagement, leads and sales campaigns, or LINK_CLICKS on traffic, engagement and sales. Not offered because ADSAP cannot deliver them yet: Messenger and Instagram Direct conversations, calls, event responses, reminders."
    • changedInput schema / properties / ad_sets / items / properties / optimization_goal / enum
      Previous value: -[
      -  "OFFSITE_CONVERSIONS",
      -  "LINK_CLICKS",
      -  "IMPRESSIONS",
      -  "REACH",
      -  "LANDING_PAGE_VIEWS",
      -  "LEAD_GENERATION",
      -  "VALUE",
      -  "APP_INSTALLS",
      -  "PAGE_LIKES",
      -  "PROFILE_AND_PAGE_ENGAGEMENT",
      -  "PROFILE_VISIT",
      -  "THRUPLAY",
      -  "TWO_SECOND_CONTINUOUS_VIDEO_VIEWS",
      -  "AD_RECALL_LIFT",
      -  "POST_ENGAGEMENT",
      -  "QUALITY_LEAD"
      -]New value: +[
      +  "OFFSITE_CONVERSIONS",
      +  "LINK_CLICKS",
      +  "IMPRESSIONS",
      +  "REACH",
      +  "LANDING_PAGE_VIEWS",
      +  "LEAD_GENERATION",
      +  "VALUE",
      +  "APP_INSTALLS",
      +  "PAGE_LIKES",
      +  "PROFILE_AND_PAGE_ENGAGEMENT",
      +  "PROFILE_VISIT",
      +  "THRUPLAY",
      +  "TWO_SECOND_CONTINUOUS_VIDEO_VIEWS",
      +  "AD_RECALL_LIFT",
      +  "POST_ENGAGEMENT",
      +  "QUALITY_LEAD",
      +  "CONVERSATIONS"
      +]
  3. Changed1 schema field changed
    • addedInput schema / properties / ad_sets / items / properties / targeting / properties / flexible_spec / items / properties / interests / items / properties / id / pattern
      Added value: +"^\\d+$"
  4. Changed3 schema fields changed
    • changedInput schema / properties / ad_sets / items / properties / targeting / properties / behaviors / description
      Previous value: -"Detailed targeting: behaviors, applied as a single OR group (ORs with interests when both given). Use Meta-issued ids from adsap_search_behaviors. Not allowed under Special Ad Categories."New value: +"Shorthand for ONE group of behaviors. Combined with interests, Meta ANDs the two lists (people must match both); use flexible_spec to OR them. Ids from adsap_search_behaviors or adsap_search_detailed_targeting. Housing, employment and financial campaigns accept no behaviors."
    • addedInput schema / properties / ad_sets / items / properties / targeting / properties / flexible_spec
      Added value: +{
      +  "description": "Detailed targeting groups, as in Ads Manager (\"Include people who match at least ONE of the following\", then \"Narrow audience\"). OR inside a group, AND between groups: [{\"interests\":[A],\"behaviors\":[B]},{\"family_statuses\":[C]}] reaches people who match (A or B) and C. Group keys are Meta segment types: take each item's type and id from adsap_search_detailed_targeting. Meta supports only this shape; (A and B) or (C and D) needs two ad sets. Max 25 groups. Housing, employment and financial campaigns accept approved interests only. Meta removed \"exclude people who match\" for detailed targeting in 2025; exclude custom audiences with excluded_custom_audiences instead. If interests / behaviors are also given, each becomes an extra group (ANDed).",
      +  "items": {
      +    "additionalProperties": false,
      +    "properties": {
      +      "behaviors": {
      +        "items": {
      +          "$ref": "#/properties/ad_sets/items/properties/targeting/properties/flexible_spec/items/properties/interests/items"
      +        },
      +        "type": "array"
      +      },
      +      "college_years": {
      +        "items": {
      +          "$ref": "#/properties/ad_sets/items/properties/targeting/properties/flexible_spec/items/properties/interests/items"
      +        },
      +        "type": "array"
      +      },
      +      "education_majors": {
      +        "items": {
      +          "$ref": "#/properties/ad_sets/items/properties/targeting/properties/flexible_spec/items/properties/interests/items"
      +        },
      +        "type": "array"
      +      },
      +      "education_schools": {
      +        "items": {
      +          "$ref": "#/properties/ad_sets/items/properties/targeting/properties/flexible_spec/items/properties/interests/items"
      +        },
      +        "type": "array"
      +      },
      +      "education_statuses": {
      +        "items": {
      +          "$ref": "#/properties/ad_sets/items/properties/targeting/properties/flexible_spec/items/properties/interests/items"
      +        },
      +        "type": "array"
      +      },
      +      "family_statuses": {
      +        "items": {
      +          "$ref": "#/properties/ad_sets/items/properties/targeting/properties/flexible_spec/items/properties/interests/items"
      +        },
      +        "type": "array"
      +      },
      +      "income": {
      +        "items": {
      +          "$ref": "#/properties/ad_sets/items/properties/targeting/properties/flexible_spec/items/properties/interests/items"
      +        },
      +        "type": "array"
      +      },
      +      "industries": {
      +        "items": {
      +          "$ref": "#/properties/ad_sets/items/properties/targeting/properties/flexible_spec/items/properties/interests/items"
      +        },
      +        "type": "array"
      +      },
      +      "interests": {
      +        "items": {
      +          "additionalProperties": false,
      +          "properties": {
      +            "id": {
      +              "type": "string"
      +            },
      +            "name": {
      +              "type": "string"
      +            }
      +          },
      +          "required": [
      +            "id"
      +          ],
      +          "type": "object"
      +        },
      +        "type": "array"
      +      },
      +      "life_events": {
      +        "items": {
      +          "$ref": "#/properties/ad_sets/items/properties/targeting/properties/flexible_spec/items/properties/interests/items"
      +        },
      +        "type": "array"
      +      },
      +      "relationship_statuses": {
      +        "items": {
      +          "$ref": "#/properties/ad_sets/items/properties/targeting/properties/flexible_spec/items/properties/interests/items"
      +        },
      +        "type": "array"
      +      },
      +      "user_adclusters": {
      +        "items": {
      +          "$ref": "#/properties/ad_sets/items/properties/targeting/properties/flexible_spec/items/properties/interests/items"
      +        },
      +        "type": "array"
      +      },
      +      "work_employers": {
      +        "items": {
      +          "$ref": "#/properties/ad_sets/items/properties/targeting/properties/flexible_spec/items/properties/interests/items"
      +        },
      +        "type": "array"
      +      },
      +      "work_positions": {
      +        "items": {
      +          "$ref": "#/properties/ad_sets/items/properties/targeting/properties/flexible_spec/items/properties/interests/items"
      +        },
      +        "type": "array"
      +      }
      +    },
      +    "type": "object"
      +  },
      +  "maxItems": 25,
      +  "type": "array"
      +}
    • changedInput schema / properties / ad_sets / items / properties / targeting / properties / interests / description
      Previous value: -"Detailed targeting: interests, applied as a single OR group. Use Meta-issued ids from adsap_search_interests (free text is rejected by Meta). Not allowed under Special Ad Categories."New value: +"Shorthand for ONE group of interests (people who match at least one). When behaviors is also given, Meta ANDs the two lists: people must match an interest AND a behavior. To OR interests with behaviors or demographics, or to set your own AND/OR logic, use flexible_spec instead. Ids from adsap_search_interests or adsap_search_detailed_targeting (free text is rejected by Meta)."
  5. Changed4 schema fields changed
    • changedInput schema / properties / ad_sets / items / properties / targeting / properties / excluded_geo / description
      Previous value: -"IGNORED at creation (not forwarded to the backend). Apply post-create via adsap_update_entity updates.targeting."New value: +"Geo locations to EXCLUDE. Applied automatically right after creation via a follow-up targeting update (the create backend does not take it directly)."
    • changedInput schema / properties / ad_sets / items / properties / targeting / properties / locales / description
      Previous value: -"IGNORED at creation (not forwarded to the backend). Apply post-create via adsap_update_entity updates.targeting."New value: +"Language locale ids to target. Applied automatically right after creation via a follow-up targeting update."
    • changedInput schema / properties / ad_sets / items / properties / targeting / properties / location_types / description
      Previous value: -"IGNORED at creation (not forwarded to the backend)."New value: +"Geo location_types (e.g. [\"home\",\"recent\"]). Applied automatically right after creation via a follow-up targeting update."
    • changedInput schema / properties / ad_sets / items / properties / targeting / properties / targeting_optimization / description
      Previous value: -"IGNORED at creation (not forwarded to the backend)."New value: +"Advantage+ audience on/off (targeting_automation.advantage_audience). Applied automatically right after creation via a follow-up targeting update."
  6. First observed

TDQS

A4.2/5.0
Behavior3/5

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

With no annotations supplied, the description does the heavy lifting: it discloses that ad sets are created PAUSED, the batch cap, the dry-run review-card workflow, and which destination types are rejected. However, it omits other mutation-relevant behavior such as permission requirements and what a partial batch failure returns, so coverage is strong but incomplete for a high-impact write tool.

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?

The purpose is front-loaded, but the remainder is a dense wall of text that restates schema-level destination and optimization rules at length. Almost every sentence carries operational content, yet the lack of structure makes it harder to scan than necessary.

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?

Given a complex batch mutation tool with no annotations and no output schema, the description covers the critical workflow, prerequisites, unsupported cases, and key special configurations. The remaining gaps are secondary behavioral details rather than anything an agent needs in order to call it correctly.

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 already 100%, so the baseline is 3, but the description adds genuinely cross-parameter meaning: App promotion requires promoted_object.application_id plus object_store_url, OS targeting is derived from the store URL, and WhatsApp destination rules constrain optimization_goal and page_id. These relationships are not fully derivable from individual schema fields.

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?

Opens with a specific verb and resource ('Create one or more Meta ad sets under an existing campaign') and immediately bounds scope with the batch maximum of 20. It is clearly distinguishable from sibling creation tools such as adsap_create_ad and adsap_create_campaign.

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?

Explicitly directs the agent to call with dry_run: true first and describes the launch-review-card confirmation loop, including when not to call the real create from chat. It also names prerequisites (list_meta_assets, list_pixel_events) and enumerates unsupported destinations with the required fallback behavior.

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