meta-ads-mcp 0.4.5__tar.gz → 0.4.6__tar.gz
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-0.4.5 → meta_ads_mcp-0.4.6}/PKG-INFO +1 -1
- {meta_ads_mcp-0.4.5 → meta_ads_mcp-0.4.6}/meta_ads_mcp/__init__.py +1 -1
- {meta_ads_mcp-0.4.5 → meta_ads_mcp-0.4.6}/meta_ads_mcp/core/ads.py +65 -2
- {meta_ads_mcp-0.4.5 → meta_ads_mcp-0.4.6}/pyproject.toml +1 -1
- {meta_ads_mcp-0.4.5 → meta_ads_mcp-0.4.6}/.github/workflows/publish.yml +0 -0
- {meta_ads_mcp-0.4.5 → meta_ads_mcp-0.4.6}/.github/workflows/test.yml +0 -0
- {meta_ads_mcp-0.4.5 → meta_ads_mcp-0.4.6}/.gitignore +0 -0
- {meta_ads_mcp-0.4.5 → meta_ads_mcp-0.4.6}/CUSTOM_META_APP.md +0 -0
- {meta_ads_mcp-0.4.5 → meta_ads_mcp-0.4.6}/Dockerfile +0 -0
- {meta_ads_mcp-0.4.5 → meta_ads_mcp-0.4.6}/LICENSE +0 -0
- {meta_ads_mcp-0.4.5 → meta_ads_mcp-0.4.6}/LOCAL_INSTALLATION.md +0 -0
- {meta_ads_mcp-0.4.5 → meta_ads_mcp-0.4.6}/META_API_NOTES.md +0 -0
- {meta_ads_mcp-0.4.5 → meta_ads_mcp-0.4.6}/README.md +0 -0
- {meta_ads_mcp-0.4.5 → meta_ads_mcp-0.4.6}/RELEASE.md +0 -0
- {meta_ads_mcp-0.4.5 → meta_ads_mcp-0.4.6}/STREAMABLE_HTTP_SETUP.md +0 -0
- {meta_ads_mcp-0.4.5 → meta_ads_mcp-0.4.6}/examples/README.md +0 -0
- {meta_ads_mcp-0.4.5 → meta_ads_mcp-0.4.6}/examples/example_http_client.py +0 -0
- {meta_ads_mcp-0.4.5 → meta_ads_mcp-0.4.6}/future_improvements.md +0 -0
- {meta_ads_mcp-0.4.5 → meta_ads_mcp-0.4.6}/images/meta-ads-example.png +0 -0
- {meta_ads_mcp-0.4.5 → meta_ads_mcp-0.4.6}/meta_ads_auth.sh +0 -0
- {meta_ads_mcp-0.4.5 → meta_ads_mcp-0.4.6}/meta_ads_mcp/__main__.py +0 -0
- {meta_ads_mcp-0.4.5 → meta_ads_mcp-0.4.6}/meta_ads_mcp/core/__init__.py +0 -0
- {meta_ads_mcp-0.4.5 → meta_ads_mcp-0.4.6}/meta_ads_mcp/core/accounts.py +0 -0
- {meta_ads_mcp-0.4.5 → meta_ads_mcp-0.4.6}/meta_ads_mcp/core/ads_library.py +0 -0
- {meta_ads_mcp-0.4.5 → meta_ads_mcp-0.4.6}/meta_ads_mcp/core/adsets.py +0 -0
- {meta_ads_mcp-0.4.5 → meta_ads_mcp-0.4.6}/meta_ads_mcp/core/api.py +0 -0
- {meta_ads_mcp-0.4.5 → meta_ads_mcp-0.4.6}/meta_ads_mcp/core/auth.py +0 -0
- {meta_ads_mcp-0.4.5 → meta_ads_mcp-0.4.6}/meta_ads_mcp/core/authentication.py +0 -0
- {meta_ads_mcp-0.4.5 → meta_ads_mcp-0.4.6}/meta_ads_mcp/core/budget_schedules.py +0 -0
- {meta_ads_mcp-0.4.5 → meta_ads_mcp-0.4.6}/meta_ads_mcp/core/callback_server.py +0 -0
- {meta_ads_mcp-0.4.5 → meta_ads_mcp-0.4.6}/meta_ads_mcp/core/campaigns.py +0 -0
- {meta_ads_mcp-0.4.5 → meta_ads_mcp-0.4.6}/meta_ads_mcp/core/duplication.py +0 -0
- {meta_ads_mcp-0.4.5 → meta_ads_mcp-0.4.6}/meta_ads_mcp/core/http_auth_integration.py +0 -0
- {meta_ads_mcp-0.4.5 → meta_ads_mcp-0.4.6}/meta_ads_mcp/core/insights.py +0 -0
- {meta_ads_mcp-0.4.5 → meta_ads_mcp-0.4.6}/meta_ads_mcp/core/pipeboard_auth.py +0 -0
- {meta_ads_mcp-0.4.5 → meta_ads_mcp-0.4.6}/meta_ads_mcp/core/reports.py +0 -0
- {meta_ads_mcp-0.4.5 → meta_ads_mcp-0.4.6}/meta_ads_mcp/core/resources.py +0 -0
- {meta_ads_mcp-0.4.5 → meta_ads_mcp-0.4.6}/meta_ads_mcp/core/server.py +0 -0
- {meta_ads_mcp-0.4.5 → meta_ads_mcp-0.4.6}/meta_ads_mcp/core/utils.py +0 -0
- {meta_ads_mcp-0.4.5 → meta_ads_mcp-0.4.6}/requirements.txt +0 -0
- {meta_ads_mcp-0.4.5 → meta_ads_mcp-0.4.6}/setup.py +0 -0
- {meta_ads_mcp-0.4.5 → meta_ads_mcp-0.4.6}/smithery.yaml +0 -0
- {meta_ads_mcp-0.4.5 → meta_ads_mcp-0.4.6}/tests/README.md +0 -0
- {meta_ads_mcp-0.4.5 → meta_ads_mcp-0.4.6}/tests/README_REGRESSION_TESTS.md +0 -0
- {meta_ads_mcp-0.4.5 → meta_ads_mcp-0.4.6}/tests/__init__.py +0 -0
- {meta_ads_mcp-0.4.5 → meta_ads_mcp-0.4.6}/tests/conftest.py +0 -0
- {meta_ads_mcp-0.4.5 → meta_ads_mcp-0.4.6}/tests/test_duplication.py +0 -0
- {meta_ads_mcp-0.4.5 → meta_ads_mcp-0.4.6}/tests/test_duplication_regression.py +0 -0
- {meta_ads_mcp-0.4.5 → meta_ads_mcp-0.4.6}/tests/test_http_transport.py +0 -0
- {meta_ads_mcp-0.4.5 → meta_ads_mcp-0.4.6}/tests/test_openai.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: meta-ads-mcp
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.6
|
|
4
4
|
Summary: Model Context Protocol (MCP) plugin 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
|
|
@@ -806,11 +806,74 @@ async def get_account_pages(access_token: str = None, account_id: str = None) ->
|
|
|
806
806
|
if page_details["data"]:
|
|
807
807
|
return json.dumps(page_details, indent=2)
|
|
808
808
|
|
|
809
|
+
# Approach 4: Extract page IDs from tracking_specs in ads
|
|
810
|
+
# Inspired by praveen92y's implementation for robust page detection
|
|
811
|
+
# This approach is often the most reliable as confirmed by community feedback
|
|
812
|
+
endpoint = f"{account_id}/ads"
|
|
813
|
+
params = {
|
|
814
|
+
"fields": "id,name,adset_id,campaign_id,status,creative,created_time,updated_time,bid_amount,conversion_domain,tracking_specs",
|
|
815
|
+
"limit": 100
|
|
816
|
+
}
|
|
817
|
+
|
|
818
|
+
tracking_ads_data = await make_api_request(endpoint, access_token, params)
|
|
819
|
+
|
|
820
|
+
tracking_page_ids = set()
|
|
821
|
+
if "data" in tracking_ads_data:
|
|
822
|
+
for ad in tracking_ads_data.get("data", []):
|
|
823
|
+
tracking_specs = ad.get("tracking_specs", [])
|
|
824
|
+
if isinstance(tracking_specs, list):
|
|
825
|
+
for spec in tracking_specs:
|
|
826
|
+
# If 'page' key exists, add all page IDs
|
|
827
|
+
if isinstance(spec, dict) and "page" in spec:
|
|
828
|
+
page_list = spec["page"]
|
|
829
|
+
if isinstance(page_list, list):
|
|
830
|
+
for page_id in page_list:
|
|
831
|
+
# Validate page ID format (should be numeric string)
|
|
832
|
+
if isinstance(page_id, (str, int)) and str(page_id).isdigit():
|
|
833
|
+
tracking_page_ids.add(str(page_id))
|
|
834
|
+
|
|
835
|
+
if tracking_page_ids:
|
|
836
|
+
page_details = {"data": [], "source": "tracking_specs", "note": "Page IDs extracted from active ads - these are the most reliable for ad creation"}
|
|
837
|
+
for page_id in tracking_page_ids:
|
|
838
|
+
page_endpoint = f"{page_id}"
|
|
839
|
+
page_params = {
|
|
840
|
+
"fields": "id,name,username,category,fan_count,link,verification_status,picture"
|
|
841
|
+
}
|
|
842
|
+
|
|
843
|
+
page_data = await make_api_request(page_endpoint, access_token, page_params)
|
|
844
|
+
if "id" in page_data:
|
|
845
|
+
# Add additional context about this page ID being suitable for ads
|
|
846
|
+
page_data["_meta"] = {
|
|
847
|
+
"suitable_for_ads": True,
|
|
848
|
+
"found_in_tracking_specs": True,
|
|
849
|
+
"recommended_for_create_ad_creative": True
|
|
850
|
+
}
|
|
851
|
+
page_details["data"].append(page_data)
|
|
852
|
+
else:
|
|
853
|
+
page_details["data"].append({
|
|
854
|
+
"id": page_id,
|
|
855
|
+
"error": "Page details not found",
|
|
856
|
+
"_meta": {
|
|
857
|
+
"suitable_for_ads": True,
|
|
858
|
+
"found_in_tracking_specs": True,
|
|
859
|
+
"note": "Page ID exists in ads but details not accessible - you can still use this ID for ad creation"
|
|
860
|
+
}
|
|
861
|
+
})
|
|
862
|
+
|
|
863
|
+
if page_details["data"]:
|
|
864
|
+
return json.dumps(page_details, indent=2)
|
|
865
|
+
|
|
809
866
|
# If all approaches failed, return empty data with a message
|
|
810
867
|
return json.dumps({
|
|
811
868
|
"data": [],
|
|
812
|
-
"message": "No pages found associated with this account",
|
|
813
|
-
"
|
|
869
|
+
"message": "No pages found associated with this account using automated methods",
|
|
870
|
+
"troubleshooting": {
|
|
871
|
+
"suggestion_1": "If you have existing ads, run 'get_ads' and look for page IDs in the 'tracking_specs' field",
|
|
872
|
+
"suggestion_2": "Use the exact page ID from existing ads' tracking_specs for creating new ad creatives",
|
|
873
|
+
"suggestion_3": "Verify your page ID format - it should be a numeric string (e.g., '123456789')",
|
|
874
|
+
"suggestion_4": "Check for digit transpositions or formatting errors in your page ID"
|
|
875
|
+
},
|
|
876
|
+
"note": "Based on community feedback, page IDs from existing ads' tracking_specs are the most reliable for ad creation"
|
|
814
877
|
}, indent=2)
|
|
815
878
|
|
|
816
879
|
except Exception as e:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|