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.

feat: add regional regulated categories to adset create/update (#54)

Yves Junqueirafa3469bd839f
diff --git a/meta_ads_mcp/__init__.py b/meta_ads_mcp/__init__.py
index 87ca80c..60cec54 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.66"
+__version__ = "1.0.67"
__all__ = [
'get_ad_accounts',
diff --git a/meta_ads_mcp/core/adsets.py b/meta_ads_mcp/core/adsets.py
index 69dd512..ce76dac 100644
--- a/meta_ads_mcp/core/adsets.py
+++ b/meta_ads_mcp/core/adsets.py
@@ -107,6 +107,8 @@ async def create_adset(
is_dynamic_creative: Optional[bool] = None,
frequency_control_specs: Optional[List[Dict[str, Any]]] = None,
multi_advertiser_ads: Optional[int] = None,
+ regional_regulated_categories: Optional[List[str]] = None,
+ regional_regulation_identities: Optional[Dict[str, Any]] = None,
access_token: Optional[str] = None
) -> str:
"""
@@ -159,6 +161,20 @@ async def create_adset(
Example: [{"event": "IMPRESSIONS", "interval_days": 7, "max_frequency": 1}]
multi_advertiser_ads: Set to 0 to opt out of Multi-Advertiser Ads, 1 to opt in.
This is a TOP-LEVEL ad set parameter — do NOT put it inside the targeting object.
+ regional_regulated_categories: List of regional regulated categories for the ad set.
+ Required for ads targeting regulated regions (Taiwan, Australia, etc.).
+ Valid values: TAIWAN_FINSERV, TAIWAN_UNIVERSAL, AUSTRALIA_FINSERV,
+ INDIA_FINSERV, SINGAPORE_UNIVERSAL, THAILAND_UNIVERSAL.
+ Example: ["TAIWAN_UNIVERSAL"] or ["TAIWAN_FINSERV", "TAIWAN_UNIVERSAL"]
+ regional_regulation_identities: Dict of verified identity IDs for regional transparency compliance.
+ Required when regional_regulated_categories is set.
+ The identity IDs come from completing advertiser verification in Meta Business Settings.
+ Keys depend on the categories declared:
+ - TAIWAN_UNIVERSAL: taiwan_universal_beneficiary, taiwan_universal_payer
+ - TAIWAN_FINSERV: taiwan_finserv_beneficiary, taiwan_finserv_payer
+ - AUSTRALIA_FINSERV: australia_finserv_beneficiary, australia_finserv_payer
+ - SINGAPORE_UNIVERSAL: singapore_universal_beneficiary, singapore_universal_payer
+ Example: {"taiwan_universal_beneficiary": "<id>", "taiwan_universal_payer": "<id>"}
access_token: Meta API access token (optional - will use cached token if not provided)
"""
# Check required parameters
@@ -364,12 +380,18 @@ async def create_adset(
if multi_advertiser_ads is not None:
params["multi_advertiser_ads"] = str(multi_advertiser_ads)
+ if regional_regulated_categories is not None:
+ params["regional_regulated_categories"] = json.dumps(regional_regulated_categories)
+
+ if regional_regulation_identities is not None:
+ params["regional_regulation_identities"] = json.dumps(regional_regulation_identities)
+
try:
data = await make_api_request(endpoint, access_token, params, method="POST")
return json.dumps(data, indent=2)
except Exception as e:
error_msg = str(e)
-
+
# Enhanced error handling for DSA beneficiary issues
if "permission" in error_msg.lower() or "insufficient" in error_msg.lower():
return json.dumps({
@@ -413,6 +435,8 @@ async def update_adset(adset_id: str, frequency_control_specs: Optional[List[Dic
dsa_beneficiary: Optional[str] = None,
dsa_payor: Optional[str] = None,
multi_advertiser_ads: Optional[int] = None,
+ regional_regulated_categories: Optional[List[str]] = None,
+ regional_regulation_identities: Optional[Dict[str, Any]] = None,
access_token: Optional[str] = None) -> str:
"""
Update an ad set with new settings including frequency caps and budgets.
@@ -450,6 +474,14 @@ async def update_adset(adset_id: str, frequency_control_specs: Optional[List[Dic
Required for EU-targeted ad sets along with dsa_beneficiary.
multi_advertiser_ads: Set to 0 to opt out of Multi-Advertiser Ads, 1 to opt in.
This is a TOP-LEVEL ad set parameter — do NOT put it inside the targeting object.
+ regional_regulated_categories: List of regional regulated categories for the ad set.
+ Required for ads targeting regulated regions (Taiwan, Australia, etc.).
+ Valid values: TAIWAN_FINSERV, TAIWAN_UNIVERSAL, AUSTRALIA_FINSERV,
+ INDIA_FINSERV, SINGAPORE_UNIVERSAL, THAILAND_UNIVERSAL.
+ Set to null/empty to remove existing categories.
+ regional_regulation_identities: Dict of verified identity IDs for regional transparency compliance.
+ Required when regional_regulated_categories is set.
+ Set individual keys to null to remove them.
access_token: Meta API access token (optional - will use cached token if not provided)
"""
if not adset_id:
@@ -551,6 +583,12 @@ async def update_adset(adset_id: str, frequency_control_specs: Optional[List[Dic
if multi_advertiser_ads is not None:
params['multi_advertiser_ads'] = str(multi_advertiser_ads)
+ if regional_regulated_categories is not None:
+ params['regional_regulated_categories'] = json.dumps(regional_regulated_categories)
+
+ if regional_regulation_identities is not None:
+ params['regional_regulation_identities'] = json.dumps(regional_regulation_identities)
+
if not params:
return json.dumps({"error": "No update parameters provided"}, indent=2)
diff --git a/pyproject.toml b/pyproject.toml
index 8b2c7e6..9f239d8 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
[project]
name = "meta-ads-mcp"
-version = "1.0.66"
+version = "1.0.67"
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 e86cef3..926c9fb 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.66",
+ "version": "1.0.67",
"remotes": [
{
"type": "streamable-http",