Skip to content

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.

Add lead_gen_form_id parameter to ad creative functions (v1.0.20)

Yves Junqueira361288612290
diff --git a/meta_ads_mcp/__init__.py b/meta_ads_mcp/__init__.py
index 73b3031..33355ac 100644
--- a/meta_ads_mcp/__init__.py
+++ b/meta_ads_mcp/__init__.py
@@ -6,7 +6,7 @@ This package provides a Meta Ads MCP integration
from meta_ads_mcp.core.server import main
-__version__ = "1.0.19"
+__version__ = "1.0.20"
__all__ = [
'get_ad_accounts',
diff --git a/meta_ads_mcp/core/ads.py b/meta_ads_mcp/core/ads.py
index bfe1c46..b7105c6 100644
--- a/meta_ads_mcp/core/ads.py
+++ b/meta_ads_mcp/core/ads.py
@@ -759,6 +759,7 @@ async def create_ad_creative(
descriptions: Optional[List[str]] = None,
dynamic_creative_spec: Optional[Dict[str, Any]] = None,
call_to_action_type: Optional[str] = None,
+ lead_gen_form_id: Optional[str] = None,
instagram_actor_id: Optional[str] = None
) -> str:
"""
@@ -778,6 +779,8 @@ async def create_ad_creative(
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:
@@ -910,9 +913,13 @@ async def create_ad_creative(
# Add call_to_action to link_data for simple creatives
if call_to_action_type:
- creative_data["object_story_spec"]["link_data"]["call_to_action"] = {
- "type": call_to_action_type
- }
+ cta_data = {"type": call_to_action_type}
+
+ # Add lead form ID to value object if provided (required for lead generation campaigns)
+ if lead_gen_form_id:
+ cta_data["value"] = {"lead_gen_form_id": lead_gen_form_id}
+
+ creative_data["object_story_spec"]["link_data"]["call_to_action"] = cta_data
# Add dynamic creative spec if provided
if dynamic_creative_spec:
@@ -965,7 +972,8 @@ async def update_ad_creative(
description: Optional[str] = None,
descriptions: Optional[List[str]] = None,
dynamic_creative_spec: Optional[Dict[str, Any]] = None,
- call_to_action_type: Optional[str] = None
+ call_to_action_type: Optional[str] = None,
+ lead_gen_form_id: Optional[str] = None
) -> str:
"""
Update an existing ad creative with new content or settings.
@@ -981,6 +989,8 @@ async def update_ad_creative(
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
@@ -1045,7 +1055,7 @@ async def update_ad_creative(
update_data["asset_feed_spec"] = asset_feed_spec
else:
# Use traditional object_story_spec with link_data for simple creatives
- if message or headline or description or call_to_action_type:
+ if message or headline or description or call_to_action_type or lead_gen_form_id:
update_data["object_story_spec"] = {"link_data": {}}
if message:
@@ -1060,10 +1070,17 @@ async def update_ad_creative(
update_data["object_story_spec"]["link_data"]["description"] = description
# Add call_to_action to link_data for simple creatives
- if call_to_action_type:
- update_data["object_story_spec"]["link_data"]["call_to_action"] = {
- "type": call_to_action_type
- }
+ if call_to_action_type or lead_gen_form_id:
+ cta_data = {}
+ if call_to_action_type:
+ cta_data["type"] = call_to_action_type
+
+ # Add lead form ID to value object if provided (required for lead generation campaigns)
+ if lead_gen_form_id:
+ cta_data["value"] = {"lead_gen_form_id": lead_gen_form_id}
+
+ if cta_data:
+ update_data["object_story_spec"]["link_data"]["call_to_action"] = cta_data
# Add dynamic creative spec if provided
if dynamic_creative_spec:
diff --git a/pyproject.toml b/pyproject.toml
index b4e75b8..6085b0b 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
[project]
name = "meta-ads-mcp"
-version = "1.0.19"
+version = "1.0.20"
description = "Model Context Protocol (MCP) server for Meta Ads - Use Remote MCP at pipeboard.co for easiest setup"
readme = "README.md"
requires-python = ">=3.10"
diff --git a/server.json b/server.json
index 81de7fa..a3a4223 100644
--- a/server.json
+++ b/server.json
@@ -2,7 +2,7 @@
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
"name": "co.pipeboard/meta-ads-mcp",
"description": "Facebook / Meta Ads automation with AI: analyze performance, test creatives, optimize spend.",
- "version": "1.0.19",
+ "version": "1.0.20",
"remotes": [
{
"type": "streamable-http",