meta-ads-mcp 0.11.1__py3-none-any.whl → 0.11.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- meta_ads_mcp/__init__.py +1 -1
- meta_ads_mcp/core/ads.py +4 -0
- meta_ads_mcp/core/adsets.py +16 -5
- {meta_ads_mcp-0.11.1.dist-info → meta_ads_mcp-0.11.2.dist-info}/METADATA +1 -1
- {meta_ads_mcp-0.11.1.dist-info → meta_ads_mcp-0.11.2.dist-info}/RECORD +8 -8
- {meta_ads_mcp-0.11.1.dist-info → meta_ads_mcp-0.11.2.dist-info}/WHEEL +0 -0
- {meta_ads_mcp-0.11.1.dist-info → meta_ads_mcp-0.11.2.dist-info}/entry_points.txt +0 -0
- {meta_ads_mcp-0.11.1.dist-info → meta_ads_mcp-0.11.2.dist-info}/licenses/LICENSE +0 -0
meta_ads_mcp/__init__.py
CHANGED
meta_ads_mcp/core/ads.py
CHANGED
|
@@ -111,6 +111,10 @@ async def create_ad(
|
|
|
111
111
|
tracking_specs: Optional tracking specifications (e.g., for pixel events).
|
|
112
112
|
Example: [{"action.type":"offsite_conversion","fb_pixel":["YOUR_PIXEL_ID"]}]
|
|
113
113
|
access_token: Meta API access token (optional - will use cached token if not provided)
|
|
114
|
+
|
|
115
|
+
Note:
|
|
116
|
+
Dynamic Creative creatives require the parent ad set to have `is_dynamic_creative=true`.
|
|
117
|
+
Otherwise, ad creation will fail with error_subcode 1885998.
|
|
114
118
|
"""
|
|
115
119
|
# Check required parameters
|
|
116
120
|
if not account_id:
|
meta_ads_mcp/core/adsets.py
CHANGED
|
@@ -27,14 +27,14 @@ async def get_adsets(account_id: str, access_token: Optional[str] = None, limit:
|
|
|
27
27
|
if campaign_id:
|
|
28
28
|
endpoint = f"{campaign_id}/adsets"
|
|
29
29
|
params = {
|
|
30
|
-
"fields": "id,name,campaign_id,status,daily_budget,lifetime_budget,targeting,bid_amount,bid_strategy,optimization_goal,billing_event,start_time,end_time,created_time,updated_time,frequency_control_specs{event,interval_days,max_frequency}",
|
|
30
|
+
"fields": "id,name,campaign_id,status,daily_budget,lifetime_budget,targeting,bid_amount,bid_strategy,optimization_goal,billing_event,start_time,end_time,created_time,updated_time,is_dynamic_creative,frequency_control_specs{event,interval_days,max_frequency}",
|
|
31
31
|
"limit": limit
|
|
32
32
|
}
|
|
33
33
|
else:
|
|
34
34
|
# Use account endpoint if no campaign_id is given
|
|
35
35
|
endpoint = f"{account_id}/adsets"
|
|
36
36
|
params = {
|
|
37
|
-
"fields": "id,name,campaign_id,status,daily_budget,lifetime_budget,targeting,bid_amount,bid_strategy,optimization_goal,billing_event,start_time,end_time,created_time,updated_time,frequency_control_specs{event,interval_days,max_frequency}",
|
|
37
|
+
"fields": "id,name,campaign_id,status,daily_budget,lifetime_budget,targeting,bid_amount,bid_strategy,optimization_goal,billing_event,start_time,end_time,created_time,updated_time,is_dynamic_creative,frequency_control_specs{event,interval_days,max_frequency}",
|
|
38
38
|
"limit": limit
|
|
39
39
|
}
|
|
40
40
|
# Note: Removed the attempt to add campaign_id to params for the account endpoint case,
|
|
@@ -67,7 +67,7 @@ async def get_adset_details(adset_id: str, access_token: Optional[str] = None) -
|
|
|
67
67
|
endpoint = f"{adset_id}"
|
|
68
68
|
# Explicitly prioritize frequency_control_specs in the fields request
|
|
69
69
|
params = {
|
|
70
|
-
"fields": "id,name,campaign_id,status,frequency_control_specs{event,interval_days,max_frequency},daily_budget,lifetime_budget,targeting,bid_amount,bid_strategy,optimization_goal,billing_event,start_time,end_time,created_time,updated_time,attribution_spec,destination_type,promoted_object,pacing_type,budget_remaining,dsa_beneficiary"
|
|
70
|
+
"fields": "id,name,campaign_id,status,frequency_control_specs{event,interval_days,max_frequency},daily_budget,lifetime_budget,targeting,bid_amount,bid_strategy,optimization_goal,billing_event,start_time,end_time,created_time,updated_time,attribution_spec,destination_type,promoted_object,pacing_type,budget_remaining,dsa_beneficiary,is_dynamic_creative"
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
data = await make_api_request(endpoint, access_token, params)
|
|
@@ -100,6 +100,7 @@ async def create_adset(
|
|
|
100
100
|
dsa_beneficiary: Optional[str] = None,
|
|
101
101
|
promoted_object: Optional[Dict[str, Any]] = None,
|
|
102
102
|
destination_type: Optional[str] = None,
|
|
103
|
+
is_dynamic_creative: Optional[bool] = None,
|
|
103
104
|
access_token: Optional[str] = None
|
|
104
105
|
) -> str:
|
|
105
106
|
"""
|
|
@@ -125,8 +126,9 @@ async def create_adset(
|
|
|
125
126
|
Optional fields: custom_event_type, pixel_id, page_id.
|
|
126
127
|
Example: {"application_id": "123456789012345", "object_store_url": "https://apps.apple.com/app/id123456789"}
|
|
127
128
|
destination_type: Where users are directed after clicking the ad (e.g., 'APP_STORE', 'DEEPLINK', 'APP_INSTALL', 'ON_AD').
|
|
128
|
-
|
|
129
|
-
|
|
129
|
+
Required for mobile app campaigns and lead generation campaigns.
|
|
130
|
+
Use 'ON_AD' for lead generation campaigns where user interaction happens within the ad.
|
|
131
|
+
is_dynamic_creative: Enable Dynamic Creative for this ad set (required when using dynamic creatives with asset_feed_spec/dynamic_creative_spec).
|
|
130
132
|
access_token: Meta API access token (optional - will use cached token if not provided)
|
|
131
133
|
"""
|
|
132
134
|
# Check required parameters
|
|
@@ -249,6 +251,10 @@ async def create_adset(
|
|
|
249
251
|
if destination_type:
|
|
250
252
|
params["destination_type"] = destination_type
|
|
251
253
|
|
|
254
|
+
# Enable Dynamic Creative if requested
|
|
255
|
+
if is_dynamic_creative is not None:
|
|
256
|
+
params["is_dynamic_creative"] = "true" if bool(is_dynamic_creative) else "false"
|
|
257
|
+
|
|
252
258
|
try:
|
|
253
259
|
data = await make_api_request(endpoint, access_token, params, method="POST")
|
|
254
260
|
return json.dumps(data, indent=2)
|
|
@@ -290,6 +296,7 @@ async def create_adset(
|
|
|
290
296
|
async def update_adset(adset_id: str, frequency_control_specs: Optional[List[Dict[str, Any]]] = None, bid_strategy: Optional[str] = None,
|
|
291
297
|
bid_amount: Optional[int] = None, status: Optional[str] = None, targeting: Optional[Dict[str, Any]] = None,
|
|
292
298
|
optimization_goal: Optional[str] = None, daily_budget: Optional[int] = None, lifetime_budget: Optional[int] = None,
|
|
299
|
+
is_dynamic_creative: Optional[bool] = None,
|
|
293
300
|
access_token: Optional[str] = None) -> str:
|
|
294
301
|
"""
|
|
295
302
|
Update an ad set with new settings including frequency caps and budgets.
|
|
@@ -306,6 +313,7 @@ async def update_adset(adset_id: str, frequency_control_specs: Optional[List[Dic
|
|
|
306
313
|
optimization_goal: Conversion optimization goal (e.g., 'LINK_CLICKS', 'CONVERSIONS', 'APP_INSTALLS', etc.)
|
|
307
314
|
daily_budget: Daily budget in account currency (in cents) as a string
|
|
308
315
|
lifetime_budget: Lifetime budget in account currency (in cents) as a string
|
|
316
|
+
is_dynamic_creative: Enable/disable Dynamic Creative for this ad set.
|
|
309
317
|
access_token: Meta API access token (optional - will use cached token if not provided)
|
|
310
318
|
"""
|
|
311
319
|
if not adset_id:
|
|
@@ -342,6 +350,9 @@ async def update_adset(adset_id: str, frequency_control_specs: Optional[List[Dic
|
|
|
342
350
|
if lifetime_budget is not None:
|
|
343
351
|
params['lifetime_budget'] = str(lifetime_budget)
|
|
344
352
|
|
|
353
|
+
if is_dynamic_creative is not None:
|
|
354
|
+
params['is_dynamic_creative'] = "true" if bool(is_dynamic_creative) else "false"
|
|
355
|
+
|
|
345
356
|
if not params:
|
|
346
357
|
return json.dumps({"error": "No update parameters provided"}, indent=2)
|
|
347
358
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: meta-ads-mcp
|
|
3
|
-
Version: 0.11.
|
|
3
|
+
Version: 0.11.2
|
|
4
4
|
Summary: Model Context Protocol (MCP) server for interacting with Meta Ads API
|
|
5
5
|
Project-URL: Homepage, https://github.com/pipeboard-co/meta-ads-mcp
|
|
6
6
|
Project-URL: Bug Tracker, https://github.com/pipeboard-co/meta-ads-mcp/issues
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
meta_ads_mcp/__init__.py,sha256=
|
|
1
|
+
meta_ads_mcp/__init__.py,sha256=_HR7vonE1f9_lXIt5q071NDx0wXfAzE4_pUd600YZ5w,1477
|
|
2
2
|
meta_ads_mcp/__main__.py,sha256=XaQt3iXftG_7f0Zu7Wop9SeFgrD2WBn0EQOaPMc27d8,207
|
|
3
3
|
meta_ads_mcp/core/__init__.py,sha256=IEJtqpyUo0CZSUWeQPljQ-D2vKorTFwXnpBQWSi1hIM,1819
|
|
4
4
|
meta_ads_mcp/core/accounts.py,sha256=7Zoqq0zMIJi_Xsxe9-_b3EYx-UTeieJJvO7HxVRuUS0,4327
|
|
5
|
-
meta_ads_mcp/core/ads.py,sha256=
|
|
5
|
+
meta_ads_mcp/core/ads.py,sha256=gda9FRDAgIFzUjLuyKVWB0H-CfEvWI7hdbB3B22BTUg,60306
|
|
6
6
|
meta_ads_mcp/core/ads_library.py,sha256=smGz9FhM6RIUjlQT4Jv1BaZmXahGdK21eRCB7QMhK-4,3228
|
|
7
|
-
meta_ads_mcp/core/adsets.py,sha256=
|
|
7
|
+
meta_ads_mcp/core/adsets.py,sha256=3Ok3EwPTReKshtsVs4gRMlws6LMTUJTb4ZeGPPM8JR8,16570
|
|
8
8
|
meta_ads_mcp/core/api.py,sha256=58F6fRrg3ny_vuLgHu1ZN1yueNAxVXz_nEcF6JlxlWk,16469
|
|
9
9
|
meta_ads_mcp/core/auth.py,sha256=l_IvejK2KYXg8yhBiP0ifE6mGwJ6ZujqYQbVw1KOUME,23649
|
|
10
10
|
meta_ads_mcp/core/authentication.py,sha256=ftoKec1HpfYCCVYIVKUD3ezvVAk6n_CJlBuePn8fzpM,10547
|
|
@@ -21,8 +21,8 @@ meta_ads_mcp/core/resources.py,sha256=-zIIfZulpo76vcKv6jhAlQq91cR2SZ3cjYZt3ek3x0
|
|
|
21
21
|
meta_ads_mcp/core/server.py,sha256=9SlgM_qvdlxo24ctnZzLgW1e1nfAspCSx3YyJQkKP64,17856
|
|
22
22
|
meta_ads_mcp/core/targeting.py,sha256=-QziS2MvTWzM02pwiUtId4sblWURd3UYPR_YYfVuiUk,13913
|
|
23
23
|
meta_ads_mcp/core/utils.py,sha256=ytj41yC5SqduLrAiZYBSd6OUwlJRaIClTwnnYKpNFds,9387
|
|
24
|
-
meta_ads_mcp-0.11.
|
|
25
|
-
meta_ads_mcp-0.11.
|
|
26
|
-
meta_ads_mcp-0.11.
|
|
27
|
-
meta_ads_mcp-0.11.
|
|
28
|
-
meta_ads_mcp-0.11.
|
|
24
|
+
meta_ads_mcp-0.11.2.dist-info/METADATA,sha256=7nrtNc4OjmsqvqbevG4Brw9JVsyZ_772xz9lPMOymgc,24265
|
|
25
|
+
meta_ads_mcp-0.11.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
26
|
+
meta_ads_mcp-0.11.2.dist-info/entry_points.txt,sha256=Dv2RkoBjRJBqj6CyhwqGIiwPCD-SCL1-7B9-zmVRuv0,57
|
|
27
|
+
meta_ads_mcp-0.11.2.dist-info/licenses/LICENSE,sha256=E2d762fbhwKRYn8o7J6Szr6vyBPrHVDlK3jbHPx-d84,3851
|
|
28
|
+
meta_ads_mcp-0.11.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|