Skip to main content
Glama

Server Details

Facebook / Meta Ads automation with AI: analyze performance, test creatives, optimize spend.

Status
Healthy
Last Tested
Transport
Streamable HTTP
URL

Available Tools

36 tools
bulk_get_insightsTry in Inspector

⭐ PREMIUM FEATURE ⭐

Fetches performance insights for multiple ad accounts in parallel.

⚠️ Requires: Premium or Enterprise plan 💡 Value: Analyze performance data across all your campaigns at scale

Args: level: The aggregation level. Supported values: "account", "campaign" time_range: Time period for insights (default: "last_7d") Supported values: last_7d, last_14d, last_30d, last_90d, lifetime account_ids: Array of account IDs to filter (optional). If omitted, fetches all accounts. fields: Custom fields to fetch (optional). Default: impressions, clicks, spend, ctr, cpc, cpm, reach, actions, action_values use_cache: Whether to use cached data (default: true) limit: Maximum accounts to return per request (default: 20, max: 50) offset: Number of accounts to skip for pagination (default: 0)

Returns: JSON response with summary (total_accounts, successful, failed, cached, total_campaigns for campaign level), results array with per-account or per-campaign insights, execution_time_ms, and pagination metadata (has_more, next_offset, total)

Example Usage: # Fetch account-level insights for first 20 accounts (default) bulk_get_insights( level="account" )

# Fetch campaign-level insights for specific accounts bulk_get_insights( level="campaign", account_ids=["act_123456", "act_789012"], time_range="last_30d" ) # Fetch with pagination bulk_get_insights( level="campaign", limit=50, offset=0 ) # Force fresh data (bypass cache) bulk_get_insights( level="campaign", use_cache=false )
ParametersJSON Schema
NameRequiredDescriptionDefault
levelYesThe aggregation level. Supported values: "account", "campaign"
limitNoMaximum accounts to return per request (default: 20, max: 50)
fieldsNoCustom fields to fetch (optional)
offsetNoNumber of accounts to skip for pagination (default: 0)
use_cacheNoWhether to use cached data (default: true)
time_rangeNoTime period for insights (default: "last_7d")
account_idsNoArray of account IDs to filter (optional)
date_presetNoAlias for time_range
bulk_update_adsTry in Inspector

⭐ PREMIUM FEATURE ⭐

Update multiple ads with individual or uniform parameters. Supports both explicit ID-based updates and filter-based batch updates.

⚠️ Requires: Premium or Enterprise plan 💡 Value: Manage hundreds of ads efficiently and save hours of manual work

Limits: Default limit of 20 entities per operation for safety. Can be increased up to 200 maximum by setting the 'limit' parameter (requires user confirmation for large updates).

Args: account_id: Meta Ads account ID (format: act_XXXXXXXXX) access_token: Meta API access token (optional) dry_run: If true, returns list of entities that would be affected without making changes (default: false) limit: Maximum number of entities to update (default: 20, max: 200). Use higher values with caution and user confirmation

# Mode 1: Explicit updates (mutually exclusive with filter mode) ad_updates: List of ad update specifications (optional) [{ "ad_id": "string", "name": "string (optional)", "status": "string (optional)", "creative_id": "string (optional)", "bid_amount": "integer (optional)", "tracking_specs": "array (optional)" }] # Mode 2: Filter-based updates (mutually exclusive with ad_updates) filter: Filter criteria to select ads (optional) { "status": "string (optional)", "campaign_id": "string (optional)", "adset_id": "string (optional)", "adset_ids": "array (optional)", "name_contains": "string (optional)", "ad_ids": "array (optional)" } updates: Uniform updates to apply to all matching ads (required when using filter) { "status": "string (optional)", "name": "string (optional)", "creative_id": "string (optional)", "bid_amount": "integer (optional)", "tracking_specs": "array (optional)" }

Returns: JSON response with matched/updated/failed/skipped counts and detailed results

Example Usage: # Mode 1: Update specific ads bulk_update_ads( account_id="act_123456", ad_updates=[ {"ad_id": "345", "status": "ACTIVE"}, {"ad_id": "678", "status": "ACTIVE"} ] )

# Mode 2: Pause all ads in an ad set bulk_update_ads( account_id="act_123456", filter={"adset_id": "789", "status": "ACTIVE"}, updates={"status": "PAUSED"} ) # Swap creative across multiple ads bulk_update_ads( account_id="act_123456", filter={"campaign_id": "123", "name_contains": "Summer"}, updates={"creative_id": "999"} )
ParametersJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum number of entities to update in a single operation (default: 20, max: 200). Increase with caution.
filterNoFilter criteria to select ads (filter mode)
dry_runNoIf true, returns list of entities that would be affected without making changes (default: false)
updatesNoUniform updates to apply to all matching ads (filter mode)
account_idYesMeta Ads account ID (format: act_XXXXXXXXX)
ad_updatesNoList of ad update specifications (explicit mode)
access_tokenNoMeta API access token (optional - will use cached token if not provided)
bulk_update_adsetsTry in Inspector

⭐ PREMIUM FEATURE ⭐

Update multiple ad sets with individual or uniform parameters. Supports both explicit ID-based updates and filter-based batch updates.

⚠️ Requires: Premium or Enterprise plan 💡 Value: Efficiently manage ad set configurations and budgets at scale

Limits: Default limit of 20 entities per operation for safety. Can be increased up to 200 maximum by setting the 'limit' parameter (requires user confirmation for large updates).

Args: account_id: Meta Ads account ID (format: act_XXXXXXXXX) access_token: Meta API access token (optional) dry_run: If true, returns list of entities that would be affected without making changes (default: false) limit: Maximum number of entities to update (default: 20, max: 200). Use higher values with caution and user confirmation

# Mode 1: Explicit updates (mutually exclusive with filter mode) adset_updates: List of ad set update specifications (optional) [{ "adset_id": "string", "name": "string (optional)", "status": "string (optional)", "daily_budget": "integer (optional)", "lifetime_budget": "integer (optional)", "bid_amount": "integer (optional)", "bid_strategy": "string (optional)", "optimization_goal": "string (optional)", "targeting": "object (optional)", "frequency_control_specs": "array (optional)", "is_dynamic_creative": "boolean (optional)" }] # Mode 2: Filter-based updates (mutually exclusive with adset_updates) filter: Filter criteria to select ad sets (optional) { "status": "string (optional)", "campaign_id": "string (optional)", "campaign_ids": "array (optional)", "name_contains": "string (optional)", "adset_ids": "array (optional)", "optimization_goal": "string (optional)" } updates: Uniform updates to apply to all matching ad sets (required when using filter) { "status": "string (optional)", "name": "string (optional)", "daily_budget": "integer (optional)", "daily_budget_multiplier": "float (optional)", "lifetime_budget": "integer (optional)", "bid_amount": "integer (optional)", "bid_amount_multiplier": "float (optional)", "bid_strategy": "string (optional)", "optimization_goal": "string (optional)", "targeting": "object (optional)", "frequency_control_specs": "array (optional)", "is_dynamic_creative": "boolean (optional)" }

Returns: JSON response with matched/updated/failed/skipped counts and detailed results

Example Usage: # Mode 1: Update specific ad sets bulk_update_adsets( account_id="act_123456", adset_updates=[ {"adset_id": "789", "bid_amount": 500}, {"adset_id": "012", "bid_amount": 750, "status": "ACTIVE"} ] )

# Mode 2: Add frequency cap to all ad sets in a campaign bulk_update_adsets( account_id="act_123456", filter={"campaign_id": "123", "status": "ACTIVE"}, updates={ "frequency_control_specs": [ {"event": "IMPRESSIONS", "interval_days": 7, "max_frequency": 3} ] } ) # Scale bid amounts by 20% for underperforming ad sets bulk_update_adsets( account_id="act_123456", filter={"campaign_id": "123", "optimization_goal": "LINK_CLICKS"}, updates={"bid_amount_multiplier": 1.2} )
ParametersJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum number of entities to update in a single operation (default: 20, max: 200). Increase with caution.
filterNoFilter criteria to select ad sets (filter mode)
dry_runNoIf true, returns list of entities that would be affected without making changes (default: false)
updatesNoUniform updates to apply to all matching ad sets (filter mode)
account_idYesMeta Ads account ID (format: act_XXXXXXXXX)
access_tokenNoMeta API access token (optional - will use cached token if not provided)
adset_updatesNoList of ad set update specifications (explicit mode)
bulk_update_campaignsTry in Inspector

⭐ PREMIUM FEATURE ⭐

Update multiple campaigns with individual or uniform parameters. Supports both explicit ID-based updates and filter-based batch updates.

⚠️ Requires: Premium or Enterprise plan 💡 Value: Manage multiple campaigns at scale and automate optimization tasks

Limits: Default limit of 20 entities per operation for safety. Can be increased up to 200 maximum by setting the 'limit' parameter (requires user confirmation for large updates).

Args: account_id: Meta Ads account ID (format: act_XXXXXXXXX) access_token: Meta API access token (optional) dry_run: If true, returns list of entities that would be affected without making changes (default: false) limit: Maximum number of entities to update (default: 20, max: 200). Use higher values with caution and user confirmation

# Mode 1: Explicit updates (mutually exclusive with filter mode) campaign_updates: List of campaign update specifications (optional) [{ "campaign_id": "string", "name": "string (optional)", "status": "string (optional)", "daily_budget": "integer (optional)", "lifetime_budget": "integer (optional)", "bid_strategy": "string (optional)", "spend_cap": "integer (optional)" }] # Mode 2: Filter-based updates (mutually exclusive with campaign_updates) filter: Filter criteria to select campaigns (optional) { "status": "string (optional)", "objective": "string (optional)", "name_contains": "string (optional)", "campaign_ids": "array (optional)", "min_daily_budget": "integer (optional)", "max_daily_budget": "integer (optional)" } updates: Uniform updates to apply to all matching campaigns (required when using filter) { "status": "string (optional)", "name": "string (optional)", "daily_budget": "integer (optional)", "daily_budget_multiplier": "float (optional)", "lifetime_budget": "integer (optional)", "bid_strategy": "string (optional)", "spend_cap": "integer (optional)" }

Returns: JSON response with matched/updated/failed/skipped counts and detailed results

Example Usage: # Mode 1: Update specific campaigns bulk_update_campaigns( account_id="act_123456", campaign_updates=[ {"campaign_id": "123", "status": "PAUSED"}, {"campaign_id": "456", "status": "PAUSED", "daily_budget": 15000} ] )

# Mode 2: Update filtered campaigns bulk_update_campaigns( account_id="act_123456", filter={"status": "ACTIVE", "name_contains": "Holiday"}, updates={"status": "PAUSED"} ) # Scale budgets by 50% for campaigns under $100/day bulk_update_campaigns( account_id="act_123456", filter={"status": "ACTIVE", "max_daily_budget": 10000}, updates={"daily_budget_multiplier": 1.5} )
ParametersJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum number of entities to update in a single operation (default: 20, max: 200). Increase with caution.
filterNoFilter criteria to select campaigns (filter mode)
dry_runNoIf true, returns list of entities that would be affected without making changes (default: false)
updatesNoUniform updates to apply to all matching campaigns (filter mode)
account_idYesMeta Ads account ID (format: act_XXXXXXXXX)
access_tokenNoMeta API access token (optional - will use cached token if not provided)
campaign_updatesNoList of campaign update specifications (explicit mode)
create_adTry in Inspector

Create a new ad with an existing creative.

Args: account_id: Meta Ads account ID (format: act_XXXXXXXXX) name: Ad name adset_id: Ad set ID where this ad will be placed creative_id: ID of an existing creative to use status: Initial ad status (default: PAUSED) bid_amount: Optional bid amount in account currency (in cents) tracking_specs: Optional tracking specifications (e.g., for pixel events). Example: [{"action.type":"offsite_conversion","fb_pixel":["YOUR_PIXEL_ID"]}] access_token: Meta API access token (optional - will use cached token if not provided)

Note: Dynamic Creative creatives require the parent ad set to have is_dynamic_creative=true. Otherwise, ad creation will fail with error_subcode 1885998.

ParametersJSON Schema
NameRequiredDescriptionDefault
nameYes
statusNoPAUSED
adset_idYes
account_idYes
bid_amountNo
creative_idYes
access_tokenNo
tracking_specsNo
create_ad_creativeTry in Inspector

Create a new ad creative using an uploaded image hash.

Args: account_id: Meta Ads account ID (format: act_XXXXXXXXX) image_hash: Hash of the uploaded image access_token: Meta API access token (optional - will use cached token if not provided) name: Creative name page_id: Facebook Page ID to be used for the ad link_url: Destination URL for the ad message: Ad copy/text headline: Single headline for simple ads (cannot be used with headlines) headlines: List of headlines for dynamic creative testing (cannot be used with headline) description: Single description for simple ads (cannot be used with descriptions) descriptions: List of descriptions for dynamic creative testing (cannot be used with description) dynamic_creative_spec: Dynamic creative optimization settings call_to_action_type: Call to action button type (e.g., 'LEARN_MORE', 'SIGN_UP', 'SHOP_NOW') lead_gen_form_id: Lead generation form ID for lead generation campaigns. Required when using lead generation CTAs like 'SIGN_UP', 'GET_OFFER', 'SUBSCRIBE', etc. instagram_actor_id: Optional Instagram account ID for Instagram placements

Returns: JSON response with created creative details

ParametersJSON Schema
NameRequiredDescriptionDefault
nameNo
messageNo
page_idNo
headlineNo
link_urlNo
headlinesNo
account_idYes
image_hashYes
descriptionNo
access_tokenNo
descriptionsNo
lead_gen_form_idNo
instagram_actor_idNo
call_to_action_typeNo
dynamic_creative_specNo
create_adsetTry in Inspector

Create a new ad set in a Meta Ads account.

Args: account_id: Meta Ads account ID (format: act_XXXXXXXXX) campaign_id: Meta Ads campaign ID this ad set belongs to name: Ad set name optimization_goal: Conversion optimization goal (e.g., 'LINK_CLICKS', 'REACH', 'CONVERSIONS', 'APP_INSTALLS') billing_event: How you're charged (e.g., 'IMPRESSIONS', 'LINK_CLICKS') status: Initial ad set status (default: PAUSED) daily_budget: Daily budget in account currency (in cents) as a string lifetime_budget: Lifetime budget in account currency (in cents) as a string targeting: Targeting specifications including age, location, interests, etc. Use targeting_automation.advantage_audience=1 for automatic audience finding bid_amount: Bid amount in account currency (in cents) bid_strategy: Bid strategy (e.g., 'LOWEST_COST', 'LOWEST_COST_WITH_BID_CAP') start_time: Start time in ISO 8601 format (e.g., '2023-12-01T12:00:00-0800') end_time: End time in ISO 8601 format dsa_beneficiary: DSA beneficiary (person/organization benefiting from ads) for European compliance promoted_object: Mobile app configuration for APP_INSTALLS campaigns. Required fields: application_id, object_store_url. Optional fields: custom_event_type, pixel_id, page_id. Example: {"application_id": "123456789012345", "object_store_url": "https://apps.apple.com/app/id123456789"} destination_type: Where users are directed after clicking the ad (e.g., 'APP_STORE', 'DEEPLINK', 'APP_INSTALL', 'ON_AD'). Required for mobile app campaigns and lead generation campaigns. Use 'ON_AD' for lead generation campaigns where user interaction happens within the ad. is_dynamic_creative: Enable Dynamic Creative for this ad set (required when using dynamic creatives with asset_feed_spec/dynamic_creative_spec). access_token: Meta API access token (optional - will use cached token if not provided)

ParametersJSON Schema
NameRequiredDescriptionDefault
nameYes
statusNoPAUSED
end_timeNo
targetingNo
account_idYes
bid_amountNo
start_timeNo
campaign_idYes
access_tokenNo
bid_strategyNo
daily_budgetNo
billing_eventYes
dsa_beneficiaryNo
lifetime_budgetNo
promoted_objectNo
destination_typeNo
optimization_goalYes
is_dynamic_creativeNo
create_budget_scheduleTry in Inspector

Create a budget schedule for a Meta Ads campaign.

Allows scheduling budget increases based on anticipated high-demand periods. The times should be provided as Unix timestamps.

Args: campaign_id: Meta Ads campaign ID. budget_value: Amount of budget increase. Interpreted based on budget_value_type. budget_value_type: Type of budget value - "ABSOLUTE" or "MULTIPLIER". time_start: Unix timestamp for when the high demand period should start. time_end: Unix timestamp for when the high demand period should end. access_token: Meta API access token (optional - will use cached token if not provided).

Returns: A JSON string containing the ID of the created budget schedule or an error message.

ParametersJSON Schema
NameRequiredDescriptionDefault
time_endYes
time_startYes
campaign_idYes
access_tokenNo
budget_valueYes
budget_value_typeYes
create_campaignTry in Inspector

Create a new campaign in a Meta Ads account.

Args: account_id: Meta Ads account ID (format: act_XXXXXXXXX) name: Campaign name objective: Campaign objective (ODAX, outcome-based). Must be one of: OUTCOME_AWARENESS, OUTCOME_TRAFFIC, OUTCOME_ENGAGEMENT, OUTCOME_LEADS, OUTCOME_SALES, OUTCOME_APP_PROMOTION. Note: Legacy objectives like BRAND_AWARENESS, LINK_CLICKS, CONVERSIONS, APP_INSTALLS, etc. are not valid for new campaigns and will cause a 400 error. Use the outcome-based values above (e.g., BRAND_AWARENESS → OUTCOME_AWARENESS). access_token: Meta API access token (optional - will use cached token if not provided) status: Initial campaign status (default: PAUSED) special_ad_categories: List of special ad categories if applicable daily_budget: Daily budget in account currency (in cents) as a string (only used if use_adset_level_budgets=False) lifetime_budget: Lifetime budget in account currency (in cents) as a string (only used if use_adset_level_budgets=False) buying_type: Buying type (e.g., 'AUCTION') bid_strategy: Bid strategy. Must be one of: 'LOWEST_COST_WITHOUT_CAP', 'LOWEST_COST_WITH_BID_CAP', 'COST_CAP', 'LOWEST_COST_WITH_MIN_ROAS'. bid_cap: Bid cap in account currency (in cents) as a string spend_cap: Spending limit for the campaign in account currency (in cents) as a string campaign_budget_optimization: Whether to enable campaign budget optimization (only used if use_adset_level_budgets=False) ab_test_control_setups: Settings for A/B testing (e.g., [{"name":"Creative A", "ad_format":"SINGLE_IMAGE"}]) use_adset_level_budgets: If True, budgets will be set at the ad set level instead of campaign level (default: False)

ParametersJSON Schema
NameRequiredDescriptionDefault
nameYes
statusNoPAUSED
bid_capNo
objectiveYes
spend_capNo
account_idYes
buying_typeNo
access_tokenNo
bid_strategyNo
daily_budgetNo
lifetime_budgetNo
special_ad_categoriesNo
ab_test_control_setupsNo
use_adset_level_budgetsNo
campaign_budget_optimizationNo
create_carousel_ad_creativeTry in Inspector

⭐ PREMIUM FEATURE ⭐

Create a carousel ad creative with multiple images/videos (2-10 cards). Carousel ads allow users to swipe through multiple images or videos in a single ad unit.

⚠️ Requires: Premium or Enterprise plan 💡 Value: Create engaging multi-card ads that showcase multiple products or tell a story

Args: account_id: Meta Ads account ID (format: act_XXXXXXXXX) - required page_id: Facebook Page ID to associate with the creative - required child_attachments: Array of 2-10 cards for the carousel - required [{ "link": "URL for this card (required)", "image_hash": "Image hash from upload_ad_image (required if no video_id)", "video_id": "Video ID (required if no image_hash)", "name": "Headline text (optional, max 40 chars)", "description": "Description text (optional, max 20 chars)", "call_to_action": {"type": "SHOP_NOW", "value": {"link": "..."}} (optional) }] message: Primary text shown above the carousel (optional) link: Default destination URL (optional, defaults to first card's link) call_to_action_type: Global CTA type (optional) Options: SHOP_NOW, LEARN_MORE, BOOK_NOW, DOWNLOAD, GET_QUOTE, SUBSCRIBE, WATCH_MORE multi_share_end_card: Show end card with Page profile photo (optional, default: true) multi_share_optimized: Let Meta optimize card order (optional, default: true) instagram_actor_id: Instagram account ID for Instagram placement (optional) access_token: Meta API access token (optional)

Returns: JSON response with success status, creative_id, and details

Example Usage: # Create a basic carousel with 3 product cards create_carousel_ad_creative( account_id="act_123456", page_id="987654321", child_attachments=[ {"link": "https://shop.com/product1", "image_hash": "abc123", "name": "Product 1", "description": "Only $19.99"}, {"link": "https://shop.com/product2", "image_hash": "def456", "name": "Product 2", "description": "Only $29.99"}, {"link": "https://shop.com/product3", "image_hash": "ghi789", "name": "Product 3", "description": "Only $39.99"} ], message="Check out our best sellers!", call_to_action_type="SHOP_NOW" )

ParametersJSON Schema
NameRequiredDescriptionDefault
linkNoDefault destination URL
messageNoPrimary text shown above the carousel
page_idYesFacebook Page ID to associate with the creative
account_idYesMeta Ads account ID (format: act_XXXXXXXXX)
access_tokenNoMeta API access token (optional)
child_attachmentsYesArray of 2-10 carousel cards. Each card must have: link (required), image_hash or video_id (one required), name (optional, max 40 chars), description (optional, max 20 chars), call_to_action (optional object with type and value)
instagram_actor_idNoInstagram account ID for Instagram placement
call_to_action_typeNoGlobal call-to-action type
multi_share_end_cardNoShow end card with Page profile photo (default: true)
multi_share_optimizedNoLet Meta optimize card order (default: true)
estimate_audience_sizeTry in Inspector

Estimate audience size for targeting specifications using Meta's delivery_estimate API.

This function provides comprehensive audience estimation for complex targeting combinations including demographics, geography, interests, and behaviors. It also maintains backwards compatibility for simple interest validation.

Args: access_token: Meta API access token (optional - will use cached token if not provided) account_id: Meta Ads account ID (format: act_XXXXXXXXX) - required for comprehensive estimation targeting: Complete targeting specification including demographics, geography, interests, etc. Example: { "age_min": 25, "age_max": 65, "geo_locations": {"countries": ["PL"]}, "flexible_spec": [ {"interests": [{"id": "6003371567474"}]}, {"interests": [{"id": "6003462346642"}]} ] } optimization_goal: Optimization goal for estimation (default: "REACH"). Options: "REACH", "LINK_CLICKS", "IMPRESSIONS", "CONVERSIONS", etc. interest_list: [DEPRECATED - for backwards compatibility] List of interest names to validate interest_fbid_list: [DEPRECATED - for backwards compatibility] List of interest IDs to validate

Returns: JSON string with audience estimation results including estimated_audience_size, reach_estimate, and targeting validation

ParametersJSON Schema
NameRequiredDescriptionDefault
targetingNo
account_idNo
access_tokenNo
interest_listNo
optimization_goalNoREACH
interest_fbid_listNo
fetchTry in Inspector

Fetch complete record data by ID. It retrieves the full data for a specific record identified by its ID.

Args: id: The record ID to fetch (format: "type:id", e.g., "account:act_123456")

Returns: JSON response with complete record data including id, title, text, and metadata

Example Usage: fetch(id="account:act_123456789") fetch(id="campaign:23842588888640185") fetch(id="ad:23842614006130185") fetch(id="page:123456789")

ParametersJSON Schema
NameRequiredDescriptionDefault
idYes
get_account_infoTry in Inspector

Get detailed information about a specific ad account.

Args: account_id: Meta Ads account ID (format: act_XXXXXXXXX) access_token: Meta API access token (optional - will use cached token if not provided)

ParametersJSON Schema
NameRequiredDescriptionDefault
account_idYes
access_tokenNo
get_account_pagesTry in Inspector

Get pages associated with a Meta Ads account.

Args: account_id: Meta Ads account ID (format: act_XXXXXXXXX) access_token: Meta API access token (optional - will use cached token if not provided)

Returns: JSON response with pages associated with the account

ParametersJSON Schema
NameRequiredDescriptionDefault
account_idYes
access_tokenNo
get_ad_accountsTry in Inspector

Get ad accounts accessible by a user.

Args: access_token: Meta API access token (optional - will use cached token if not provided) user_id: Meta user ID or "me" for the current user limit: Maximum number of accounts to return (default: 200)

ParametersJSON Schema
NameRequiredDescriptionDefault
limitNo
user_idNome
access_tokenNo
get_ad_creativesTry in Inspector

Get creative details for a specific ad. Best if combined with get_ad_image to get the full image.

Args: ad_id: Meta Ads ad ID access_token: Meta API access token (optional - will use cached token if not provided)

ParametersJSON Schema
NameRequiredDescriptionDefault
ad_idYes
access_tokenNo
get_ad_detailsTry in Inspector

Get detailed information about a specific ad.

Args: ad_id: Meta Ads ad ID access_token: Meta API access token (optional - will use cached token if not provided)

ParametersJSON Schema
NameRequiredDescriptionDefault
ad_idYes
access_tokenNo
get_ad_imageTry in Inspector

Get, download, and visualize a Meta ad image in one step. Useful to see the image in the LLM.

Args: ad_id: Meta Ads ad ID access_token: Meta API access token (optional - will use cached token if not provided)

Returns: The ad image ready for direct visual analysis

ParametersJSON Schema
NameRequiredDescriptionDefault
ad_idYes
access_tokenNo
get_adsTry in Inspector

Get ads for a Meta Ads account with optional filtering.

Args: account_id: Meta Ads account ID (format: act_XXXXXXXXX) access_token: Meta API access token (optional - will use cached token if not provided) limit: Maximum number of ads to return (default: 10) campaign_id: Optional campaign ID to filter by adset_id: Optional ad set ID to filter by

ParametersJSON Schema
NameRequiredDescriptionDefault
limitNo
adset_idNo
account_idYes
campaign_idNo
access_tokenNo
get_adset_detailsTry in Inspector

Get detailed information about a specific ad set.

Args: adset_id: Meta Ads ad set ID access_token: Meta API access token (optional - will use cached token if not provided)

Example: To call this function through MCP, pass the adset_id as the first argument: { "args": "YOUR_ADSET_ID" }

ParametersJSON Schema
NameRequiredDescriptionDefault
adset_idYes
access_tokenNo
get_adsetsTry in Inspector

Get ad sets for a Meta Ads account with optional filtering by campaign.

Args: account_id: Meta Ads account ID (format: act_XXXXXXXXX) access_token: Meta API access token (optional - will use cached token if not provided) limit: Maximum number of ad sets to return (default: 10) campaign_id: Optional campaign ID to filter by

ParametersJSON Schema
NameRequiredDescriptionDefault
limitNo
account_idYes
campaign_idNo
access_tokenNo
get_campaign_detailsTry in Inspector

Get detailed information about a specific campaign.

Note: This function requests a specific set of fields ('id,name,objective,status,...'). The Meta API offers many other fields for campaigns (e.g., 'effective_status', 'source_campaign_id', etc.) that could be added to the 'fields' parameter in the code if needed.

Args: campaign_id: Meta Ads campaign ID access_token: Meta API access token (optional - will use cached token if not provided)

ParametersJSON Schema
NameRequiredDescriptionDefault
campaign_idYes
access_tokenNo
get_campaignsTry in Inspector

Get campaigns for a Meta Ads account with optional filtering.

Note: By default, the Meta API returns a subset of available fields. Other fields like 'effective_status', 'special_ad_categories', 'lifetime_budget', 'spend_cap', 'budget_remaining', 'promoted_object', 'source_campaign_id', etc., might be available but require specifying them in the API call (currently not exposed by this tool's parameters).

Args: account_id: Meta Ads account ID (format: act_XXXXXXXXX) access_token: Meta API access token (optional - will use cached token if not provided) limit: Maximum number of campaigns to return (default: 10) status_filter: Filter by effective status (e.g., 'ACTIVE', 'PAUSED', 'ARCHIVED'). Maps to the 'effective_status' API parameter, which expects an array (this function handles the required JSON formatting). Leave empty for all statuses. objective_filter: Filter by campaign objective(s). Can be a single objective string or a list of objectives. Valid objectives: 'OUTCOME_AWARENESS', 'OUTCOME_TRAFFIC', 'OUTCOME_ENGAGEMENT', 'OUTCOME_LEADS', 'OUTCOME_SALES', 'OUTCOME_APP_PROMOTION'. Examples: 'OUTCOME_LEADS' or ['OUTCOME_LEADS', 'OUTCOME_SALES']. Leave empty for all objectives. after: Pagination cursor to get the next set of results

ParametersJSON Schema
NameRequiredDescriptionDefault
afterNo
limitNo
account_idYes
access_tokenNo
status_filterNo
objective_filterNo
get_insightsTry in Inspector

Get performance insights for a campaign, ad set, ad or account.

Args: object_id: ID of the campaign, ad set, ad or account access_token: Meta API access token (optional - will use cached token if not provided) time_range: Either a preset time range string or a dictionary with "since" and "until" dates in YYYY-MM-DD format Preset options: today, yesterday, this_month, last_month, this_quarter, maximum, data_maximum, last_3d, last_7d, last_14d, last_28d, last_30d, last_90d, last_week_mon_sun, last_week_sun_sat, last_quarter, last_year, this_week_mon_today, this_week_sun_today, this_year Dictionary example: {"since":"2023-01-01","until":"2023-01-31"} breakdown: Optional breakdown dimension. Valid values include: Demographic: age, gender, country, region, dma Platform/Device: device_platform, platform_position, publisher_platform, impression_device Creative Assets: ad_format_asset, body_asset, call_to_action_asset, description_asset, image_asset, link_url_asset, title_asset, video_asset, media_asset_url, media_creator, media_destination_url, media_format, media_origin_url, media_text_content, media_type, creative_relaxation_asset_type, flexible_format_asset_type, gen_ai_asset_type Campaign/Ad Attributes: breakdown_ad_objective, breakdown_reporting_ad_id, app_id, product_id Conversion Tracking: coarse_conversion_value, conversion_destination, standard_event_content_type, signal_source_bucket, is_conversion_id_modeled, fidelity_type, redownload Time-based: hourly_stats_aggregated_by_advertiser_time_zone, hourly_stats_aggregated_by_audience_time_zone, frequency_value Extensions/Landing: ad_extension_domain, ad_extension_url, landing_destination, mdsa_landing_destination Attribution: sot_attribution_model_type, sot_attribution_window, sot_channel, sot_event_type, sot_source Mobile/SKAN: skan_campaign_id, skan_conversion_id, skan_version, postback_sequence_index CRM/Business: crm_advertiser_l12_territory_ids, crm_advertiser_subvertical_id, crm_advertiser_vertical_id, crm_ult_advertiser_id, user_persona_id, user_persona_name Advanced: hsid, is_auto_advance, is_rendered_as_delayed_skip_ad, mmm, place_page_id, marketing_messages_btn_name, impression_view_time_advertiser_hour_v2, comscore_market, comscore_market_code level: Level of aggregation (ad, adset, campaign, account) limit: Maximum number of results to return per page (default: 25, Meta API allows much higher values) after: Pagination cursor to get the next set of results. Use the 'after' cursor from previous response's paging.next field. action_attribution_windows: Optional list of attribution windows (e.g., ["1d_click", "7d_click", "1d_view"]). When specified, actions include additional fields for each window. The 'value' field always shows 7d_click.

ParametersJSON Schema
NameRequiredDescriptionDefault
afterNo
levelNoad
limitNo
breakdownNo
object_idYes
time_rangeNomaximum
access_tokenNo
action_attribution_windowsNo
get_interest_suggestionsTry in Inspector

Get interest suggestions based on existing interests.

Args: interest_list: List of interest names to get suggestions for (e.g., ["Basketball", "Soccer"]) access_token: Meta API access token (optional - will use cached token if not provided)
limit: Maximum number of suggestions to return (default: 25)

Returns: JSON string containing suggested interests with id, name, audience_size, and description fields

ParametersJSON Schema
NameRequiredDescriptionDefault
limitNo
access_tokenNo
interest_listYes
searchTry in Inspector

Search through Meta Ads data and return matching record IDs. It searches across ad accounts, campaigns, ads, pages, and businesses to find relevant records based on the provided query.

Args: query: Search query string to find relevant Meta Ads records access_token: Meta API access token (optional - will use cached token if not provided)

Returns: JSON response with list of matching record IDs

Example Usage: search(query="active campaigns") search(query="account spending") search(query="facebook ads performance") search(query="facebook pages") search(query="user businesses")

ParametersJSON Schema
NameRequiredDescriptionDefault
queryYes
access_tokenNo
search_behaviorsTry in Inspector

Get all available behavior targeting options.

Args: access_token: Meta API access token (optional - will use cached token if not provided) limit: Maximum number of results to return (default: 50)

Returns: JSON string containing behavior targeting options with id, name, audience_size bounds, path, and description

ParametersJSON Schema
NameRequiredDescriptionDefault
limitNo
access_tokenNo
search_demographicsTry in Inspector

Get demographic targeting options.

Args: access_token: Meta API access token (optional - will use cached token if not provided) demographic_class: Type of demographics to retrieve. Options: 'demographics', 'life_events', 'industries', 'income', 'family_statuses', 'user_device', 'user_os' (default: 'demographics') limit: Maximum number of results to return (default: 50)

Returns: JSON string containing demographic targeting options with id, name, audience_size bounds, path, and description

ParametersJSON Schema
NameRequiredDescriptionDefault
limitNo
access_tokenNo
demographic_classNodemographics
search_geo_locationsTry in Inspector

Search for geographic targeting locations.

Args: query: Search term for locations (e.g., "New York", "California", "Japan") access_token: Meta API access token (optional - will use cached token if not provided) location_types: Types of locations to search. Options: ['country', 'region', 'city', 'zip', 'geo_market', 'electoral_district']. If not specified, searches all types. limit: Maximum number of results to return (default: 25)

Returns: JSON string containing location data with key, name, type, and geographic hierarchy information

ParametersJSON Schema
NameRequiredDescriptionDefault
limitNo
queryYes
access_tokenNo
location_typesNo
search_interestsTry in Inspector

Search for interest targeting options by keyword.

Args: query: Search term for interests (e.g., "baseball", "cooking", "travel") access_token: Meta API access token (optional - will use cached token if not provided) limit: Maximum number of results to return (default: 25)

Returns: JSON string containing interest data with id, name, audience_size, and path fields

ParametersJSON Schema
NameRequiredDescriptionDefault
limitNo
queryYes
access_tokenNo
search_pages_by_nameTry in Inspector

Search for pages by name within an account.

Args: account_id: Meta Ads account ID (format: act_XXXXXXXXX) access_token: Meta API access token (optional - will use cached token if not provided) search_term: Search term to find pages by name (optional - returns all pages if not provided)

Returns: JSON response with matching pages

ParametersJSON Schema
NameRequiredDescriptionDefault
account_idYes
search_termNo
access_tokenNo
update_adTry in Inspector

Update an ad with new settings.

Args: ad_id: Meta Ads ad ID status: Update ad status (ACTIVE, PAUSED, etc.) bid_amount: Bid amount in account currency (in cents for USD) tracking_specs: Optional tracking specifications (e.g., for pixel events). creative_id: ID of the creative to associate with this ad (changes the ad's image/content) access_token: Meta API access token (optional - will use cached token if not provided)

ParametersJSON Schema
NameRequiredDescriptionDefault
ad_idYes
statusNo
bid_amountNo
creative_idNo
access_tokenNo
tracking_specsNo
update_ad_creativeTry in Inspector

Update an existing ad creative with new content or settings.

Args: creative_id: Meta Ads creative ID to update access_token: Meta API access token (optional - will use cached token if not provided) name: New creative name message: New ad copy/text headline: Single headline for simple ads (cannot be used with headlines) headlines: New list of headlines for dynamic creative testing (cannot be used with headline) description: Single description for simple ads (cannot be used with descriptions) descriptions: New list of descriptions for dynamic creative testing (cannot be used with description) dynamic_creative_spec: New dynamic creative optimization settings call_to_action_type: New call to action button type lead_gen_form_id: Lead generation form ID for lead generation campaigns. Required when using lead generation CTAs like 'SIGN_UP', 'GET_OFFER', 'SUBSCRIBE', etc.

Returns: JSON response with updated creative details

ParametersJSON Schema
NameRequiredDescriptionDefault
nameNo
messageNo
headlineNo
headlinesNo
creative_idYes
descriptionNo
access_tokenNo
descriptionsNo
lead_gen_form_idNo
call_to_action_typeNo
dynamic_creative_specNo
update_adsetTry in Inspector

Update an ad set with new settings including frequency caps and budgets.

Args: adset_id: Meta Ads ad set ID frequency_control_specs: List of frequency control specifications (e.g. [{"event": "IMPRESSIONS", "interval_days": 7, "max_frequency": 3}]) bid_strategy: Bid strategy (e.g., 'LOWEST_COST_WITH_BID_CAP') bid_amount: Bid amount in account currency (in cents for USD) status: Update ad set status (ACTIVE, PAUSED, etc.) targeting: Complete targeting specifications (will replace existing targeting) (e.g. {"targeting_automation":{"advantage_audience":1}, "geo_locations": {"countries": ["US"]}}) optimization_goal: Conversion optimization goal (e.g., 'LINK_CLICKS', 'CONVERSIONS', 'APP_INSTALLS', etc.) daily_budget: Daily budget in account currency (in cents) as a string lifetime_budget: Lifetime budget in account currency (in cents) as a string is_dynamic_creative: Enable/disable Dynamic Creative for this ad set. access_token: Meta API access token (optional - will use cached token if not provided)

ParametersJSON Schema
NameRequiredDescriptionDefault
statusNo
adset_idYes
targetingNo
bid_amountNo
access_tokenNo
bid_strategyNo
daily_budgetNo
lifetime_budgetNo
optimization_goalNo
is_dynamic_creativeNo
frequency_control_specsNo
update_campaignTry in Inspector

Update an existing campaign in a Meta Ads account.

Args: campaign_id: Meta Ads campaign ID access_token: Meta API access token (optional - will use cached token if not provided) name: New campaign name status: New campaign status (e.g., 'ACTIVE', 'PAUSED') special_ad_categories: List of special ad categories if applicable daily_budget: New daily budget in account currency (in cents) as a string. Set to empty string "" to remove the daily budget. lifetime_budget: New lifetime budget in account currency (in cents) as a string. Set to empty string "" to remove the lifetime budget. bid_strategy: New bid strategy bid_cap: New bid cap in account currency (in cents) as a string spend_cap: New spending limit for the campaign in account currency (in cents) as a string campaign_budget_optimization: Enable/disable campaign budget optimization objective: New campaign objective (Note: May not always be updatable) use_adset_level_budgets: If True, removes campaign-level budgets to switch to ad set level budgets

ParametersJSON Schema
NameRequiredDescriptionDefault
nameNo
statusNo
bid_capNo
objectiveNo
spend_capNo
campaign_idYes
access_tokenNo
bid_strategyNo
daily_budgetNo
lifetime_budgetNo
special_ad_categoriesNo
use_adset_level_budgetsNo
campaign_budget_optimizationNo
upload_ad_imageTry in Inspector

Upload an image to use in Meta Ads creatives.

Args: account_id: Meta Ads account ID (format: act_XXXXXXXXX) access_token: Meta API access token (optional - will use cached token if not provided) file: Data URL or raw base64 string of the image (e.g., "data:image/png;base64,iVBORw0KG...") image_url: Direct URL to an image to fetch and upload name: Optional name for the image (default: filename)

Returns: JSON response with image details including hash for creative creation

ParametersJSON Schema
NameRequiredDescriptionDefault
fileNo
nameNo
image_urlNo
account_idYes
access_tokenNo

FAQ

How do I claim this server?

To claim this server, publish a /.well-known/glama.json file on your server's domain with the following structure:

{ "$schema": "https://glama.ai/mcp/schemas/connector.json", "maintainers": [ { "email": "your-email@example.com" } ] }

The email address must match the email associated with your Glama account. Once verified, the server will appear as claimed by you.

What are the benefits of claiming a server?
  • Control your server's listing on Glama, including description and metadata
  • Receive usage reports showing how your server is being used
  • Get monitoring and health status updates for your server
Try in Browser

Your Connectors

Sign in to create a connector for this server.