get_linkedin_posts
Retrieve LinkedIn posts from your Metricool brand account by specifying a date range and blog ID to analyze and manage social media content effectively.
Instructions
Get the list of Linkedin 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:267-284 (handler)Handler function for the 'get_linkedin_posts' tool. It is registered via the @mcp.tool() decorator. Fetches LinkedIn posts data from the Metricool API using a GET request, with parameters for date range and blog ID.async def get_linkedin_posts(init_date: str, end_date: str, blog_id: int) -> str | dict[str, Any]: """ Get the list of Linkedin 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/linkedin?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 Linkedin Posts") return response
- src/mcp_metricool/tools/tools.py:267-267 (registration)The @mcp.tool() decorator registers the get_linkedin_posts function as an MCP tool.async def get_linkedin_posts(init_date: str, end_date: str, blog_id: int) -> str | dict[str, Any]:
- Input schema defined by function parameters and docstring: init_date (str, YYYY-MM-DD), end_date (str, YYYY-MM-DD), blog_id (int). Returns str or dict[str, Any].async def get_linkedin_posts(init_date: str, end_date: str, blog_id: int) -> str | dict[str, Any]: