meta-ads-mcp

v1.0.128
meta-ads-mcp Checked 10 hours ago Published 2 months ago

Model Context Protocol (MCP) server for Meta Ads - Use Remote MCP at pipeboard.co for easiest setup

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

get_ad_accounts

Get ad accounts accessible by a user. amount_spent and balance are returned in currency units (e.g. USD dollars), not cents. 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)

ParameterTypeDescription
access_token
limitinteger
user_idstring

get_account_info

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) fields: Optional comma-separated Graph API fields to return. When provided, replaces the default field set. Useful for fetching extras like funding_source_details, spend_cap, is_prepay_account, min_daily_budget, disable_reason, capabilities. Default fields: id, name, account_id, account_status, amo…

ParameterTypeDescription
account_id *string
access_token
fieldsstring

get_campaigns

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', '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…

ParameterTypeDescription
account_id *string
access_token
afterstring
limitinteger
objective_filter
status_filterstring

get_campaign_details

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)

ParameterTypeDescription
campaign_id *string
access_token

create_campaign

Create a new Facebook or Instagram ad campaign in a Meta Ads account. Use this to start a new campaign with an ODAX objective (OUTCOME_LEADS, OUTCOME_SALES, OUTCOME_AWARENESS, OUTCOME_TRAFFIC, OUTCOME_ENGAGEMENT, OUTCOME_APP_PROMOTION), pick CBO (campaign budget optimization) or ABO (ad-set-level budgets), and set bid strategy, spend cap, and special ad categories. This is the first step of the campaign group → ad set → ad hierarchy on Meta. Returns the new campaign id. Also known as: create campaign, new campaign, make campaign, campaign group, ABO campaign, C…

ParameterTypeDescription
account_id *string
name *string
objective *string
ab_test_control_setups
access_token
bid_cap
bid_strategystring
buying_type
campaign_budget_optimization
daily_budget
lifetime_budget
special_ad_categories
spend_cap
statusstring
use_adset_level_budgetsboolean

update_campaign

Update an existing campaign in a Meta Ads account. Note: Campaigns do not support start_time for scheduling — set start_time on the ad set instead. Migrating CBO (Advantage Campaign Budget) → ABO (ad set level budgets): Pass `adset_budgets` with one entry per ad set in the campaign. Meta atomically removes the campaign-level budget and assigns budgets at the ad set level in a single call. This is Meta's documented mechanism — the legacy `use_adset_level_budgets=true` flag attempts to clear `daily_budget`/`lifetime_budget` but Meta si…

ParameterTypeDescription
campaign_id *string
access_token
adset_budgets
bid_cap
bid_strategy
campaign_budget_optimization
daily_budget
lifetime_budget
name
objective
special_ad_categories
spend_cap
status
use_adset_level_budgets

get_adsets

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

ParameterTypeDescription
account_id *string
access_token
campaign_idstring
limitinteger

get_adset_details

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" }

ParameterTypeDescription
adset_id *string
access_token

create_adset

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. Valid values depend on the campaign objective and destination_type. OUTCOME_ENGAGEMENT + destination_type=WEBSITE: OFFSITE_CONVERSIONS, LANDING_PAGE_VIEWS, LINK_CLICKS, IMPRESSIONS, REACH. OUTCOME_ENGAGEMENT + On Post (destination_type=ON_POST): POST_ENGAGEMENT, IMPRESSIONS, R…

ParameterTypeDescription
account_id *string
billing_event *string
campaign_id *string
name *string
optimization_goal *string
access_token
attribution_spec
bid_adjustments
bid_amount
bid_constraints
bid_strategy
daily_budget
destination_type
dsa_beneficiary
dsa_payor
end_time
frequency_control_specs
is_dynamic_creative
lifetime_budget
multi_advertiser_ads
promoted_object
regional_regulated_categories
regional_regulation_identities
start_time
statusstring
targeting

update_adset

Update an ad set with new settings including frequency caps and budgets. Args: adset_id: Meta Ads ad set ID name: New ad set name frequency_control_specs: Frequency control specs (e.g. [{"event": "IMPRESSIONS", "interval_days": 7, "max_frequency": 3}]) bid_strategy: Bid strategy. Valid values: - 'LOWEST_COST_WITHOUT_CAP' (recommended) - no bid_amount required - 'LOWEST_COST_WITH_BID_CAP' - REQUIRES bid_amount - 'COST_CAP' - REQUIRES bid_amount…

ParameterTypeDescription
adset_id *string
access_token
attribution_spec
bid_adjustments
bid_amount
bid_constraints
bid_strategy
daily_budget
dsa_beneficiary
dsa_payor
end_time
frequency_control_specs
is_dynamic_creative
lifetime_budget
multi_advertiser_ads
name
optimization_goal
regional_regulated_categories
regional_regulation_identities
start_time
status
targeting

get_ads

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

ParameterTypeDescription
account_id *string
access_token
adset_idstring
campaign_idstring
limitinteger

get_ad_details

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)

ParameterTypeDescription
ad_id *string
access_token

get_creative_details

Get detailed information about a specific ad creative by its ID. Args: creative_id: Meta Ads creative ID (required) access_token: Meta API access token (optional)

ParameterTypeDescription
creative_id *string
access_token

create_ad

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 acc…

ParameterTypeDescription
account_id *string
adset_id *string
creative_id *string
name *string
access_token
bid_amount
statusstring
tracking_specs

get_ad_creatives

Get creative details for a specific ad. Requires an ad_id (not account_id). Use get_ads first to find ad IDs. Args: ad_id: Meta Ads ad ID (required) access_token: Meta API access token (optional - will use cached token if not provided)

ParameterTypeDescription
ad_id *string
access_token

get_ad_image

Get, download, and visualize the image attached to an existing Meta ad. Takes a Meta ad ID and returns the image the ad is currently serving. If all you have is an image hash (no ad), use get_image_by_hash instead. 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

ParameterTypeDescription
ad_id *string
access_token

get_image_by_hash

Get, download, and visualize a Meta ad image by its hash. Use this when you have an image_hash without an ad — e.g. the hash returned by upload_ad_image / bulk_upload_ad_images, or one referenced in a creative (object_story_spec.link_data.image_hash, asset_feed_spec images[].hash, etc.). To view the image of an existing ad, prefer get_ad_image(ad_id). Args: account_id: Meta Ads account ID (act_XXXXXXXXX or bare numeric — both accepted) image_hash: Meta image hash access_token: Meta API access token (optional - will use cached token if…

ParameterTypeDescription
account_id *string
image_hash *string
access_token

get_ad_video

Get video details and source URL for a Meta ad video creative. Returns the video source URL (direct download link), thumbnail URL, processing status, and metadata (title, description, duration). Also useful for polling after bulk_upload_ad_videos: ``video_status`` is ``"processing"`` while Meta is still transcoding and ``"ready"`` when the real video frames (and a usable thumbnail) are available. Calling create_ad_creative before status is "ready" returns an error because the only thumbnail Meta returns during processing is a generic placeholder that would…

ParameterTypeDescription
access_token
account_idstring
ad_idstring
video_idstring

update_ad

Update an ad with new settings. Args: ad_id: Meta Ads ad ID name: New ad name 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)

ParameterTypeDescription
ad_id *string
access_token
bid_amount
creative_id
name
status
tracking_specs

upload_ad_image

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 object with: - image_hash: Pass this to create_ad_creative when building the ad, or to get_image_by_hash…

ParameterTypeDescription
account_id *string
access_token
file
image_url
name

compute_image_crops

Compute image_crops coordinates for a source image of the given dimensions. Returns the image_crops dict ready to pass directly to create_ad_creative or bulk_create_ad_creatives. For each crop key the result is the largest centered region that fits within the source image while matching the key's aspect ratio — equivalent to "Original" crop (no content is cut off beyond what the ratio requires). Args: image_width: Width of the source image in pixels (e.g. 1080). image_height: Height of the source image in pixels (e.g. 1080). crop_keys: O…

ParameterTypeDescription
image_height *integer
image_width *integer
crop_keys

create_ad_creative

Create a new ad creative using an uploaded image hash, video ID, or an existing post. Supports six creative modes: - **Existing post**: Provide object_story_id (format: {page_id}_{post_id}) to promote an existing organic or published post. No image_hash or video_id required. Optionally combine with asset_customization_rules to attach a 9:16 video for Story/Reels placements. - **Simple image/video**: Single image_hash or video_id with object_story_spec - **Multi-variant copy**: Use plural text params (messages[], headlines[], descriptions[]) to test multi…

ParameterTypeDescription
account_id *string
access_token
ad_formats
asset_customization_rules
call_to_action_type
caption
creative_features_spec
description
descriptions
disable_all_enhancements
dynamic_creative_spec
event_id
facebook_branded_content
headline
headlines
image_crops
image_hash
image_hashes
images
instagram_actor_id
instagram_branded_content
lead_gen_form_id
link_url
message
messages
name
object_story_id
optimization_type
page_id
phone_number
reminder_data
thumbnail_url
url_tags
video_id
videos

update_ad_creative

Update an existing ad creative's name or optimization settings. IMPORTANT — Meta API limitation: The Meta API does NOT allow updating content fields (message, headline, description, CTA, image, video, URL) on existing creatives. Only the creative `name` and optimization settings (asset_feed_spec) can be changed. To change ad content, create a new creative with the desired content and update the ad to reference the new creative via `update_ad`. Args: creative_id: Meta Ads creative ID to update access_token: Meta API access token (optional - will…

ParameterTypeDescription
creative_id *string
access_token
ad_formats
call_to_action_type
creative_features_spec
description
descriptions
dynamic_creative_spec
headline
headlines
lead_gen_form_id
message
messages
name
optimization_type

search_pages_by_name

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

ParameterTypeDescription
account_id *string
access_token
search_term

get_account_pages

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

ParameterTypeDescription
account_id *string
access_token

get_insights

Get performance insights for a campaign, ad set, ad or account. Args: object_id: ID of the campaign, ad set, ad or account. You can also use the alias parameters below. account_id: Alias for object_id when querying account-level insights campaign_id: Alias for object_id when querying campaign-level insights adset_id: Alias for object_id when querying ad-set-level insights ad_id: Alias for object_id when querying ad-level insights access_token: Meta API access token (optional - will use cached token if not provided) time_range: E…

ParameterTypeDescription
access_token
account_idstring
action_attribution_windows
action_breakdowns
ad_idstring
adset_idstring
afterstring
breakdownstring
campaign_idstring
compactboolean
levelstring
limitinteger
object_idstring
time_range

search_ads_archive

Search the Facebook Ads Library archive. Args: search_terms: The search query for ads. ad_reached_countries: List of country codes (e.g., ["US", "GB"]). access_token: Meta API access token (optional - will use cached token if not provided). ad_type: Type of ads to search for (e.g., POLITICAL_AND_ISSUE_ADS, HOUSING_ADS, ALL). limit: Maximum number of ads to return. fields: Comma-separated string of fields to retrieve for each ad. Example Usage via curl equivalent: curl -G \…

ParameterTypeDescription
ad_reached_countries *array
search_terms *string
access_token
ad_typestring
fieldsstring
limitinteger

create_budget_schedule

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…

ParameterTypeDescription
budget_value *integer
budget_value_type *string
campaign_id *string
time_end *integer
time_start *integer
access_token

search_interests

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

ParameterTypeDescription
query *string
access_token
limitinteger

get_interest_suggestions

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

ParameterTypeDescription
interest_list *array
access_token
limitinteger

estimate_audience_size

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 specificati…

ParameterTypeDescription
access_token
account_id
interest_fbid_list
interest_list
optimization_goalstring
targeting

search_behaviors

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

ParameterTypeDescription
access_token
limitinteger

search_demographics

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

ParameterTypeDescription
access_token
demographic_classstring
limitinteger

search_geo_locations

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 geogra…

ParameterTypeDescription
query *string
access_token
limitinteger
location_types