meta-ads-mcp-local
v0.4.5Model Calling Protocol (MCP) plugin for interacting with Meta Ads API (Fork with HTTPS support)
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. 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: 10)
| Parameter | Type | Description |
|---|---|---|
access_token | string | |
limit | integer | |
user_id | string |
get_account_info
Get detailed information about a specific ad account. Args: access_token: Meta API access token (optional - will use cached token if not provided) account_id: Meta Ads account ID (format: act_XXXXXXXXX)
| Parameter | Type | Description |
|---|---|---|
access_token | string | |
account_id | string |
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', '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: access_token: Meta API access token (optional - will use cached token if not provided) account_id: Meta Ads account ID (format: a…
| Parameter | Type | Description |
|---|---|---|
access_token | string | |
account_id | string | |
after | string | |
limit | integer | |
status_filter | string |
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: access_token: Meta API access token (optional - will use cached token if not provided) campaign_id: Meta Ads campaign ID
| Parameter | Type | Description |
|---|---|---|
access_token | string | |
campaign_id | string |
create_campaign
Create a new campaign in a Meta Ads account. Args: access_token: Meta API access token (optional - will use cached token if not provided) account_id: Meta Ads account ID (format: act_XXXXXXXXX) name: Campaign name objective: Campaign objective. Validates ad objectives. enum{BRAND_AWARENESS, LEAD_GENERATION, LINK_CLICKS, CONVERSIONS, OUTCOME_TRAFFIC, etc.}. status: Initial campaign status (default: PAUSED) special_ad_categories: List of special ad categories if applicable daily_budget: Daily budget in account currency (in cen…
| Parameter | Type | Description |
|---|---|---|
ab_test_control_setups | ||
access_token | string | |
account_id | string | |
bid_cap | string | |
bid_strategy | string | |
buying_type | string | |
campaign_budget_optimization | boolean | |
daily_budget | string | |
lifetime_budget | string | |
name | string | |
objective | string | |
special_ad_categories | array | |
spend_cap | string | |
status | string |
update_campaign
Update an existing campaign in a Meta Ads account. Args: access_token: Meta API access token (optional - will use cached token if not provided) campaign_id: Meta Ads campaign ID (required) 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 lifetime_budget: New lifetime budget in account currency (in cents) as a string bid_strategy: New bid strategy…
| Parameter | Type | Description |
|---|---|---|
access_token | string | |
bid_cap | string | |
bid_strategy | string | |
campaign_budget_optimization | boolean | |
campaign_id | string | |
daily_budget | string | |
lifetime_budget | string | |
name | string | |
objective | string | |
special_ad_categories | array | |
spend_cap | string | |
status | string |
get_adsets
Get ad sets for a Meta Ads account with optional filtering by campaign. Args: access_token: Meta API access token (optional - will use cached token if not provided) account_id: Meta Ads account ID (format: act_XXXXXXXXX) limit: Maximum number of ad sets to return (default: 10) campaign_id: Optional campaign ID to filter by
| Parameter | Type | Description |
|---|---|---|
access_token | string | |
account_id | string | |
campaign_id | string | |
limit | integer |
get_adset_details
Get detailed information about a specific ad set. Args: adset_id: Meta Ads ad set ID (required) 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" }
| Parameter | Type | Description |
|---|---|---|
access_token | string | |
adset_id | string |
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 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 a…
| Parameter | Type | Description |
|---|---|---|
access_token | string | |
account_id | string | |
bid_amount | string | |
bid_strategy | string | |
billing_event | string | |
campaign_id | string | |
daily_budget | string | |
end_time | string | |
lifetime_budget | string | |
name | string | |
optimization_goal | string | |
start_time | string | |
status | string | |
targeting | object |
update_adset
Update an ad set with new settings including frequency caps. 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: Targeting specifications including targeting_automation (e.g. {…
| Parameter | Type | Description |
|---|---|---|
adset_id * | string | |
access_token | string | |
bid_amount | integer | |
bid_strategy | string | |
frequency_control_specs | array | |
optimization_goal | string | |
status | string | |
targeting | object |
get_ads
Get ads for a Meta Ads account with optional filtering. Args: access_token: Meta API access token (optional - will use cached token if not provided) account_id: Meta Ads account ID (format: act_XXXXXXXXX) 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
| Parameter | Type | Description |
|---|---|---|
access_token | string | |
account_id | string | |
adset_id | string | |
campaign_id | string | |
limit | integer |
get_ad_details
Get detailed information about a specific ad. Args: access_token: Meta API access token (optional - will use cached token if not provided) ad_id: Meta Ads ad ID
| Parameter | Type | Description |
|---|---|---|
access_token | string | |
ad_id | string |
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…
| Parameter | Type | Description |
|---|---|---|
access_token | string | |
account_id | string | |
adset_id | string | |
bid_amount | string | |
creative_id | string | |
name | string | |
status | string | |
tracking_specs |
get_ad_creatives
Get creative details for a specific ad. Best if combined with get_ad_image to get the full image. Args: access_token: Meta API access token (optional - will use cached token if not provided) ad_id: Meta Ads ad ID
| Parameter | Type | Description |
|---|---|---|
access_token | string | |
ad_id | string |
get_ad_image
Get, download, and visualize a Meta ad image in one step. Useful to see the image in the LLM. Args: access_token: Meta API access token (optional - will use cached token if not provided) ad_id: Meta Ads ad ID Returns: The ad image ready for direct visual analysis
| Parameter | Type | Description |
|---|---|---|
access_token | string | |
ad_id | string |
save_ad_image_locally
Get, download, and save a Meta ad image locally, returning the file path. Args: access_token: Meta API access token (optional - will use cached token if not provided) ad_id: Meta Ads ad ID output_dir: Directory to save the image file (default: 'ad_images') Returns: The file path to the saved image, or an error message string.
| Parameter | Type | Description |
|---|---|---|
access_token | string | |
ad_id | string | |
output_dir | string |
update_ad
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). access_token: Meta API access token (optional - will use cached token if not provided)
| Parameter | Type | Description |
|---|---|---|
ad_id * | string | |
access_token | string | |
bid_amount | integer | |
status | string | |
tracking_specs | string |
upload_ad_image
Upload an image to use in Meta Ads creatives. Args: access_token: Meta API access token (optional - will use cached token if not provided) account_id: Meta Ads account ID (format: act_XXXXXXXXX) image_path: Path to the image file to upload name: Optional name for the image (default: filename) Returns: JSON response with image details including hash for creative creation
| Parameter | Type | Description |
|---|---|---|
access_token | string | |
account_id | string | |
image_path | string | |
name | string |
create_ad_creative
Create a new ad creative using an uploaded image hash. Args: access_token: Meta API access token (optional - will use cached token if not provided) account_id: Meta Ads account ID (format: act_XXXXXXXXX) name: Creative name image_hash: Hash of the uploaded image page_id: Facebook Page ID to be used for the ad link_url: Destination URL for the ad message: Ad copy/text headline: Ad headline description: Ad description call_to_action_type: Call to action button type (e.g., 'LEARN_MORE', 'SIGN_UP', 'SHOP_…
| Parameter | Type | Description |
|---|---|---|
access_token | string | |
account_id | string | |
call_to_action_type | string | |
description | string | |
headline | string | |
image_hash | string | |
instagram_actor_id | string | |
link_url | string | |
message | string | |
name | string | |
page_id | string |
get_account_pages
Get pages associated with a Meta Ads account. Args: access_token: Meta API access token (optional - will use cached token if not provided) account_id: Meta Ads account ID (format: act_XXXXXXXXX) Returns: JSON response with pages associated with the account
| Parameter | Type | Description |
|---|---|---|
access_token | string | |
account_id | string |
get_insights
Get performance insights for a campaign, ad set, ad or account. Args: access_token: Meta API access token (optional - will use cached token if not provided) object_id: ID of the campaign, ad set, ad or account 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_we…
| Parameter | Type | Description |
|---|---|---|
access_token | string | |
breakdown | string | |
level | string | |
object_id | string | |
time_range |
debug_image_download
Debug image download issues and report detailed diagnostics. Args: access_token: Meta API access token (optional - will use cached token if not provided) url: Direct image URL to test (optional) ad_id: Meta Ads ad ID (optional, used if url is not provided)
| Parameter | Type | Description |
|---|---|---|
access_token | string | |
ad_id | string | |
url | string |
save_ad_image_via_api
Try to save an ad image by using the Marketing API's attachment endpoints. This is an alternative approach when direct image download fails. Args: access_token: Meta API access token (optional - will use cached token if not provided) ad_id: Meta Ads ad ID
| Parameter | Type | Description |
|---|---|---|
access_token | string | |
ad_id | string |
get_login_link
Get a clickable login link for Meta Ads authentication. NOTE: This method should only be used if you're using your own Facebook app. If using Pipeboard authentication (recommended), set the PIPEBOARD_API_TOKEN environment variable instead (token obtainable via https://pipeboard.co). Args: access_token: Meta API access token (optional - will use cached token if not provided) Returns: A clickable resource link for Meta authentication
| Parameter | Type | Description |
|---|---|---|
access_token | string |
search_ads_archive
Search the Facebook Ads Library archive. Args: access_token: Meta API access token (optional - will use cached token if not provided). search_terms: The search query for ads. ad_type: Type of ads to search for (e.g., POLITICAL_AND_ISSUE_ADS, HOUSING_ADS, ALL). ad_reached_countries: List of country codes (e.g., ["US", "GB"]). 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 \ -d "search_terms='california'" \ -d…
| Parameter | Type | Description |
|---|---|---|
access_token | string | |
ad_reached_countries | array | |
ad_type | string | |
fields | string | |
limit | integer | |
search_terms | string |
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…
| Parameter | Type | Description |
|---|---|---|
budget_value * | integer | |
budget_value_type * | string | |
campaign_id * | string | |
time_end * | integer | |
time_start * | integer | |
access_token | string |