get_facebookads_campaigns
Retrieve a list of Facebook Ads Campaigns from your Metricool account by specifying a date range and blog ID. Use this tool to organize and analyze campaign data efficiently.
Instructions
Get the list of Facebook Ads Campaigns from your Metricool account.
Args: init date: Init date of the period to get the data. The format is YYYYMMDD end date: End date of the period to get the data. The format is YYYYMMDD blog id: Blog id of the Metricool brand account.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| blog_id | Yes | ||
| end_date | Yes | ||
| init_date | Yes |
Implementation Reference
- src/mcp_metricool/tools/tools.py:346-364 (handler)The handler function for the get_facebookads_campaigns tool. It is decorated with @mcp.tool(), which handles registration and schema definition based on type hints and docstring. Fetches Facebook Ads campaigns data from Metricool API using a GET request.@mcp.tool() async def get_facebookads_campaigns(init_date: str, end_date: str, blog_id: int) -> str | list[dict[str, Any]]: """ Get the list of Facebook Ads Campaigns from your Metricool account. Args: init date: Init date of the period to get the data. The format is YYYYMMDD end date: End date of the period to get the data. The format is YYYYMMDD blog id: Blog id of the Metricool brand account. """ url = f"{METRICOOL_BASE_URL}/stats/facebookads/campaigns?start={init_date}&end={end_date}&blogId={blog_id}&userId={METRICOOL_USER_ID}&integrationSource=MCP" response = await make_get_request(url) if not response: return ("Failed to get Facebook Ads Campaigns") return response