Meta Ads (Facebook/Instagram) MCP server for Claude, ChatGPT, Perplexity & Cursor — the Meta node of Pipeboard’s 5-platform family (+ Google, TikTok, Snap, Reddit). Hosted remote MCP, badged Meta Business Partner, free plan — no self-hosting required.
Python advertisingai-agentschatgptclaudefacebook-adsinstagram-adsmcpmeta-adsmodel-context-protocolpipeboard
Add optimization goal parameter to update_adset function
Yves Junqueira0c3b72da245c
diff --git a/meta_ads_mcp/core/adsets.py b/meta_ads_mcp/core/adsets.pyindex a4accdd..d2f92c0 100644--- a/meta_ads_mcp/core/adsets.py+++ b/meta_ads_mcp/core/adsets.py@@ -78,7 +78,8 @@ async def get_adset_details(access_token: str = None, adset_id: str = None) -> s@mcp_server.tool()@meta_api_toolasync def update_adset(adset_id: str, frequency_control_specs: List[Dict[str, Any]] = None, bid_strategy: str = None,- bid_amount: int = None, status: str = None, targeting: Dict[str, Any] = None, access_token: str = None) -> str:+ bid_amount: int = None, status: str = None, targeting: Dict[str, Any] = None,+ optimization_goal: str = None, access_token: str = None) -> str:"""Update an ad set with new settings including frequency caps.@@ -91,6 +92,7 @@ async def update_adset(adset_id: str, frequency_control_specs: List[Dict[str, Anstatus: Update ad set status (ACTIVE, PAUSED, etc.)targeting: Targeting specifications including targeting_automation(e.g. {"targeting_automation":{"advantage_audience":1}})+ optimization_goal: Conversion optimization goal (e.g., 'LINK_CLICKS', 'CONVERSIONS', 'APP_INSTALLS', etc.)access_token: Meta API access token (optional - will use cached token if not provided)"""if not adset_id:@@ -110,6 +112,9 @@ async def update_adset(adset_id: str, frequency_control_specs: List[Dict[str, Anif status is not None:changes['status'] = status+ if optimization_goal is not None:+ changes['optimization_goal'] = optimization_goal+if targeting is not None:# Get current ad set details to preserve existing targeting settingscurrent_details_json = await get_adset_details(adset_id=adset_id, access_token=access_token)