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 toolsbulk_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" )
| Name | Required | Description | Default |
|---|---|---|---|
| level | Yes | The aggregation level. Supported values: "account", "campaign" | |
| limit | No | Maximum accounts to return per request (default: 20, max: 50) | |
| fields | No | Custom fields to fetch (optional) | |
| offset | No | Number of accounts to skip for pagination (default: 0) | |
| use_cache | No | Whether to use cached data (default: true) | |
| time_range | No | Time period for insights (default: "last_7d") | |
| account_ids | No | Array of account IDs to filter (optional) | |
| date_preset | No | Alias 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
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"} ] )
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Maximum number of entities to update in a single operation (default: 20, max: 200). Increase with caution. | |
| filter | No | Filter criteria to select ads (filter mode) | |
| dry_run | No | If true, returns list of entities that would be affected without making changes (default: false) | |
| updates | No | Uniform updates to apply to all matching ads (filter mode) | |
| account_id | Yes | Meta Ads account ID (format: act_XXXXXXXXX) | |
| ad_updates | No | List of ad update specifications (explicit mode) | |
| access_token | No | Meta 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
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"} ] )
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Maximum number of entities to update in a single operation (default: 20, max: 200). Increase with caution. | |
| filter | No | Filter criteria to select ad sets (filter mode) | |
| dry_run | No | If true, returns list of entities that would be affected without making changes (default: false) | |
| updates | No | Uniform updates to apply to all matching ad sets (filter mode) | |
| account_id | Yes | Meta Ads account ID (format: act_XXXXXXXXX) | |
| access_token | No | Meta API access token (optional - will use cached token if not provided) | |
| adset_updates | No | List 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
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} ] )
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Maximum number of entities to update in a single operation (default: 20, max: 200). Increase with caution. | |
| filter | No | Filter criteria to select campaigns (filter mode) | |
| dry_run | No | If true, returns list of entities that would be affected without making changes (default: false) | |
| updates | No | Uniform updates to apply to all matching campaigns (filter mode) | |
| account_id | Yes | Meta Ads account ID (format: act_XXXXXXXXX) | |
| access_token | No | Meta API access token (optional - will use cached token if not provided) | |
| campaign_updates | No | List 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.
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | ||
| status | No | PAUSED | |
| adset_id | Yes | ||
| account_id | Yes | ||
| bid_amount | No | ||
| creative_id | Yes | ||
| access_token | No | ||
| tracking_specs | No |
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
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | ||
| message | No | ||
| page_id | No | ||
| headline | No | ||
| link_url | No | ||
| headlines | No | ||
| account_id | Yes | ||
| image_hash | Yes | ||
| description | No | ||
| access_token | No | ||
| descriptions | No | ||
| lead_gen_form_id | No | ||
| instagram_actor_id | No | ||
| call_to_action_type | No | ||
| dynamic_creative_spec | No |
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)
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | ||
| status | No | PAUSED | |
| end_time | No | ||
| targeting | No | ||
| account_id | Yes | ||
| bid_amount | No | ||
| start_time | No | ||
| campaign_id | Yes | ||
| access_token | No | ||
| bid_strategy | No | ||
| daily_budget | No | ||
| billing_event | Yes | ||
| dsa_beneficiary | No | ||
| lifetime_budget | No | ||
| promoted_object | No | ||
| destination_type | No | ||
| optimization_goal | Yes | ||
| is_dynamic_creative | No |
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.
| Name | Required | Description | Default |
|---|---|---|---|
| time_end | Yes | ||
| time_start | Yes | ||
| campaign_id | Yes | ||
| access_token | No | ||
| budget_value | Yes | ||
| budget_value_type | Yes |
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)
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | ||
| status | No | PAUSED | |
| bid_cap | No | ||
| objective | Yes | ||
| spend_cap | No | ||
| account_id | Yes | ||
| buying_type | No | ||
| access_token | No | ||
| bid_strategy | No | ||
| daily_budget | No | ||
| lifetime_budget | No | ||
| special_ad_categories | No | ||
| ab_test_control_setups | No | ||
| use_adset_level_budgets | No | ||
| campaign_budget_optimization | No |
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" )
| Name | Required | Description | Default |
|---|---|---|---|
| link | No | Default destination URL | |
| message | No | Primary text shown above the carousel | |
| page_id | Yes | Facebook Page ID to associate with the creative | |
| account_id | Yes | Meta Ads account ID (format: act_XXXXXXXXX) | |
| access_token | No | Meta API access token (optional) | |
| child_attachments | Yes | Array 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_id | No | Instagram account ID for Instagram placement | |
| call_to_action_type | No | Global call-to-action type | |
| multi_share_end_card | No | Show end card with Page profile photo (default: true) | |
| multi_share_optimized | No | Let 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
| Name | Required | Description | Default |
|---|---|---|---|
| targeting | No | ||
| account_id | No | ||
| access_token | No | ||
| interest_list | No | ||
| optimization_goal | No | REACH | |
| interest_fbid_list | No |
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")
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes |
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)
| Name | Required | Description | Default |
|---|---|---|---|
| account_id | Yes | ||
| access_token | No |
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
| Name | Required | Description | Default |
|---|---|---|---|
| account_id | Yes | ||
| access_token | No |
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)
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | ||
| user_id | No | me | |
| access_token | No |
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)
| Name | Required | Description | Default |
|---|---|---|---|
| ad_id | Yes | ||
| access_token | No |
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)
| Name | Required | Description | Default |
|---|---|---|---|
| ad_id | Yes | ||
| access_token | No |
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
| Name | Required | Description | Default |
|---|---|---|---|
| ad_id | Yes | ||
| access_token | No |
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
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | ||
| adset_id | No | ||
| account_id | Yes | ||
| campaign_id | No | ||
| access_token | No |
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" }
| Name | Required | Description | Default |
|---|---|---|---|
| adset_id | Yes | ||
| access_token | No |
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
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | ||
| account_id | Yes | ||
| campaign_id | No | ||
| access_token | No |
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)
| Name | Required | Description | Default |
|---|---|---|---|
| campaign_id | Yes | ||
| access_token | No |
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
| Name | Required | Description | Default |
|---|---|---|---|
| after | No | ||
| limit | No | ||
| account_id | Yes | ||
| access_token | No | ||
| status_filter | No | ||
| objective_filter | No |
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.
| Name | Required | Description | Default |
|---|---|---|---|
| after | No | ||
| level | No | ad | |
| limit | No | ||
| breakdown | No | ||
| object_id | Yes | ||
| time_range | No | maximum | |
| access_token | No | ||
| action_attribution_windows | No |
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
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | ||
| access_token | No | ||
| interest_list | Yes |
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")
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | ||
| access_token | No |
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
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | ||
| access_token | No |
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
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | ||
| access_token | No | ||
| demographic_class | No | demographics |
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
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | ||
| query | Yes | ||
| access_token | No | ||
| location_types | No |
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
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | ||
| query | Yes | ||
| access_token | No |
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
| Name | Required | Description | Default |
|---|---|---|---|
| account_id | Yes | ||
| search_term | No | ||
| access_token | No |
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)
| Name | Required | Description | Default |
|---|---|---|---|
| ad_id | Yes | ||
| status | No | ||
| bid_amount | No | ||
| creative_id | No | ||
| access_token | No | ||
| tracking_specs | No |
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
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | ||
| message | No | ||
| headline | No | ||
| headlines | No | ||
| creative_id | Yes | ||
| description | No | ||
| access_token | No | ||
| descriptions | No | ||
| lead_gen_form_id | No | ||
| call_to_action_type | No | ||
| dynamic_creative_spec | No |
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)
| Name | Required | Description | Default |
|---|---|---|---|
| status | No | ||
| adset_id | Yes | ||
| targeting | No | ||
| bid_amount | No | ||
| access_token | No | ||
| bid_strategy | No | ||
| daily_budget | No | ||
| lifetime_budget | No | ||
| optimization_goal | No | ||
| is_dynamic_creative | No | ||
| frequency_control_specs | No |
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
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | ||
| status | No | ||
| bid_cap | No | ||
| objective | No | ||
| spend_cap | No | ||
| campaign_id | Yes | ||
| access_token | No | ||
| bid_strategy | No | ||
| daily_budget | No | ||
| lifetime_budget | No | ||
| special_ad_categories | No | ||
| use_adset_level_budgets | No | ||
| campaign_budget_optimization | No |
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
| Name | Required | Description | Default |
|---|---|---|---|
| file | No | ||
| name | No | ||
| image_url | No | ||
| account_id | Yes | ||
| access_token | No |
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:
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