get_facebook_posts
Retrieve Facebook posts from a Metricool brand account within a specified date range by providing the blog ID, start date, and end date in YYYY-MM-DD format.
Instructions
Get the list of Facebook Posts from your Metricool brand account.
Args: init date: Init date of the period to get the data. The format is YYYY-MM-DD end date: End date of the period to get the data. The format is YYYY-MM-DD 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:166-184 (handler)Handler function for the get_facebook_posts tool, decorated with @mcp.tool() which registers it with the MCP server. Fetches Facebook posts from the Metricool API endpoint using a GET request, with parameters for date range and blog ID. Returns the API response or an error message.@mcp.tool() async def get_facebook_posts(init_date: str, end_date: str, blog_id: int) -> str | dict[str, Any]: """ Get the list of Facebook Posts from your Metricool brand account. Args: init date: Init date of the period to get the data. The format is YYYY-MM-DD end date: End date of the period to get the data. The format is YYYY-MM-DD blog id: Blog id of the Metricool brand account. """ url = f"{METRICOOL_BASE_URL}/v2/analytics/posts/facebook?from={init_date}T00%3A00%3A00&to={end_date}T23%3A59%3A59&blogId={blog_id}&userId={METRICOOL_USER_ID}&integrationSource=MCP" response = await make_get_request(url) if not response: return ("Failed to get Facebook Posts") return response