meta-ads-mcp 1.0.18__py3-none-any.whl → 1.0.19__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/insights.py +12 -5
- {meta_ads_mcp-1.0.18.dist-info → meta_ads_mcp-1.0.19.dist-info}/METADATA +2 -1
- {meta_ads_mcp-1.0.18.dist-info → meta_ads_mcp-1.0.19.dist-info}/RECORD +7 -7
- {meta_ads_mcp-1.0.18.dist-info → meta_ads_mcp-1.0.19.dist-info}/WHEEL +0 -0
- {meta_ads_mcp-1.0.18.dist-info → meta_ads_mcp-1.0.19.dist-info}/entry_points.txt +0 -0
- {meta_ads_mcp-1.0.18.dist-info → meta_ads_mcp-1.0.19.dist-info}/licenses/LICENSE +0 -0
meta_ads_mcp/__init__.py
CHANGED
meta_ads_mcp/core/insights.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"""Insights and Reporting functionality for Meta Ads API."""
|
|
2
2
|
|
|
3
3
|
import json
|
|
4
|
-
from typing import Optional, Union, Dict
|
|
4
|
+
from typing import Optional, Union, Dict, List
|
|
5
5
|
from .api import meta_api_tool, make_api_request
|
|
6
6
|
from .utils import download_image, try_multiple_download_methods, ad_creative_images, create_resource_from_image
|
|
7
7
|
from .server import mcp_server
|
|
@@ -11,9 +11,10 @@ import datetime
|
|
|
11
11
|
|
|
12
12
|
@mcp_server.tool()
|
|
13
13
|
@meta_api_tool
|
|
14
|
-
async def get_insights(object_id: str, access_token: Optional[str] = None,
|
|
15
|
-
time_range: Union[str, Dict[str, str]] = "maximum", breakdown: str = "",
|
|
16
|
-
level: str = "ad", limit: int = 25, after: str = ""
|
|
14
|
+
async def get_insights(object_id: str, access_token: Optional[str] = None,
|
|
15
|
+
time_range: Union[str, Dict[str, str]] = "maximum", breakdown: str = "",
|
|
16
|
+
level: str = "ad", limit: int = 25, after: str = "",
|
|
17
|
+
action_attribution_windows: Optional[List[str]] = None) -> str:
|
|
17
18
|
"""
|
|
18
19
|
Get performance insights for a campaign, ad set, ad or account.
|
|
19
20
|
|
|
@@ -51,6 +52,8 @@ async def get_insights(object_id: str, access_token: Optional[str] = None,
|
|
|
51
52
|
level: Level of aggregation (ad, adset, campaign, account)
|
|
52
53
|
limit: Maximum number of results to return per page (default: 25, Meta API allows much higher values)
|
|
53
54
|
after: Pagination cursor to get the next set of results. Use the 'after' cursor from previous response's paging.next field.
|
|
55
|
+
action_attribution_windows: Optional list of attribution windows (e.g., ["1d_click", "7d_click", "1d_view"]).
|
|
56
|
+
When specified, actions include additional fields for each window. The 'value' field always shows 7d_click.
|
|
54
57
|
"""
|
|
55
58
|
if not object_id:
|
|
56
59
|
return json.dumps({"error": "No object ID provided"}, indent=2)
|
|
@@ -78,7 +81,11 @@ async def get_insights(object_id: str, access_token: Optional[str] = None,
|
|
|
78
81
|
|
|
79
82
|
if after:
|
|
80
83
|
params["after"] = after
|
|
81
|
-
|
|
84
|
+
|
|
85
|
+
if action_attribution_windows:
|
|
86
|
+
# Meta API expects single-quote format: ['1d_click','7d_click']
|
|
87
|
+
params["action_attribution_windows"] = "[" + ",".join(f"'{w}'" for w in action_attribution_windows) + "]"
|
|
88
|
+
|
|
82
89
|
data = await make_api_request(endpoint, access_token, params)
|
|
83
90
|
|
|
84
91
|
return json.dumps(data, indent=2)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: meta-ads-mcp
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.19
|
|
4
4
|
Summary: Model Context Protocol (MCP) server for Meta Ads - Use Remote MCP at pipeboard.co for easiest setup
|
|
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
|
|
@@ -389,6 +389,7 @@ For advanced users who need to self-host, the package can be installed from sour
|
|
|
389
389
|
- `time_range`: Time range for insights (default: maximum)
|
|
390
390
|
- `breakdown`: Optional breakdown dimension (e.g., age, gender, country)
|
|
391
391
|
- `level`: Level of aggregation (ad, adset, campaign, account)
|
|
392
|
+
- `action_attribution_windows` (optional): List of attribution windows for conversion data (e.g., ["1d_click", "1d_view", "7d_click", "7d_view"]). When specified, actions and cost_per_action_type include additional fields for each window. The 'value' field always shows 7d_click attribution.
|
|
392
393
|
- Returns: Performance metrics for the specified object
|
|
393
394
|
|
|
394
395
|
21. `mcp_meta_ads_get_login_link`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
meta_ads_mcp/__init__.py,sha256=
|
|
1
|
+
meta_ads_mcp/__init__.py,sha256=QKpjlX8Hak6GzWWCCr6SgEhYodi7KO13fY2MwjG4Fiw,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
|
|
@@ -13,7 +13,7 @@ meta_ads_mcp/core/callback_server.py,sha256=LIAJv9DW--83kdZ7VWWZal8xEprYjRZ8iug4
|
|
|
13
13
|
meta_ads_mcp/core/campaigns.py,sha256=LKo5B8hNUUmfVQ1iu88o8HoU9ixOlGS9lwmPu6x9keA,15604
|
|
14
14
|
meta_ads_mcp/core/duplication.py,sha256=pJ41pI9bIxNf21TSy6KkpcUsc3aSr4KIiO__sunNoq0,18909
|
|
15
15
|
meta_ads_mcp/core/http_auth_integration.py,sha256=lGpKhfzJcyWugBcYEvypY-qnlt-3UDBLqh7xAUH0DGw,12473
|
|
16
|
-
meta_ads_mcp/core/insights.py,sha256=
|
|
16
|
+
meta_ads_mcp/core/insights.py,sha256=eN9jVMyoA0CaJ76x8GZZfwJOdMvs25U4RjJUrzznFPU,5606
|
|
17
17
|
meta_ads_mcp/core/openai_deep_research.py,sha256=68ayGopnBSPEYhN9R1sFvTXtyWtM0lji9aWS3uSXnLY,18649
|
|
18
18
|
meta_ads_mcp/core/pipeboard_auth.py,sha256=vv0yc4RBcGOm7VOovud-QNV1JmvBF-njOKICzAOlyf0,24602
|
|
19
19
|
meta_ads_mcp/core/reports.py,sha256=2pXYCCjYc3MZ8GlrbSHND436W62WlbfbtMll1dfJdqE,5750
|
|
@@ -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=d2uLWbIEtucRuTgwZEdtVKLDZJgaxQ1lDtZ0ZgkBJC4,25150
|
|
23
23
|
meta_ads_mcp/core/utils.py,sha256=ytj41yC5SqduLrAiZYBSd6OUwlJRaIClTwnnYKpNFds,9387
|
|
24
|
-
meta_ads_mcp-1.0.
|
|
25
|
-
meta_ads_mcp-1.0.
|
|
26
|
-
meta_ads_mcp-1.0.
|
|
27
|
-
meta_ads_mcp-1.0.
|
|
28
|
-
meta_ads_mcp-1.0.
|
|
24
|
+
meta_ads_mcp-1.0.19.dist-info/METADATA,sha256=-mvAWil32XHGK0c-3j0vSv4RZQ85x9nmfxK_5SHhLnY,25201
|
|
25
|
+
meta_ads_mcp-1.0.19.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
26
|
+
meta_ads_mcp-1.0.19.dist-info/entry_points.txt,sha256=Dv2RkoBjRJBqj6CyhwqGIiwPCD-SCL1-7B9-zmVRuv0,57
|
|
27
|
+
meta_ads_mcp-1.0.19.dist-info/licenses/LICENSE,sha256=E2d762fbhwKRYn8o7J6Szr6vyBPrHVDlK3jbHPx-d84,3851
|
|
28
|
+
meta_ads_mcp-1.0.19.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|