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): messaging ad sets (Messenger, WhatsApp, Instagram Direct), calls, event responses, reminders, shop destinations. 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.

Input Schema

TableJSON 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 / targeting / properties / flexible_spec / items / properties / interests / items / properties / id / pattern
      Added value: +"^\\d+$"
  2. 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)."
  3. 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."
  4. First observed

TDQS

A4.8/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and does so richly: ad sets are created PAUSED by default, the dry-run launch-review-card flow and its stop rule, the out-of-band follow-up targeting updates for some fields, and App promotion requirements (Live app, derived user_os). This is well beyond what a bare schema would convey.

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

Conciseness4/5

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

Front-loads purpose and the critical dry_run instruction first, then layers operational and parameter detail. It is long and dense as a single block, but nearly every sentence carries actionable constraints for a complex tool.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a complex, high-risk write tool with no output schema and 100% schema coverage, the description covers the end-to-end flow, prerequisites, unsupported branches, and App promotion specifics — sufficient for an agent 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. The description adds meaning by explaining flexible_spec OR/AND semantics and linking ids/types to adsap_search_detailed_targeting and destinations to campaign objectives, though much of this is echoed in the schema.

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+resource: 'Create one or more Meta ad sets under an existing campaign,' and adds batch scope (max 20). It is clearly distinguishable from sibling creators like adsap_create_campaign and adsap_create_ad.

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 prescribes the workflow ('ALWAYS call with dry_run: true first'), names prerequisites (list_meta_assets, list_pixel_events), and states when-not plus the alternative ('not supported yet... point the user to Meta Ads Manager, never substitute another destination'). Nothing is left to inference.

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