Skip to main content
Glama
metricool

mcp-metricool

Official
by metricool

get_instagram_posts

Retrieve Instagram post data from your Metricool account by specifying a date range and blog ID. Extract post details for analysis or reporting.

Instructions

Get the list of Instagram Posts from your Metricool 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
NameRequiredDescriptionDefault
blog_idYes
end_dateYes
init_dateYes

Implementation Reference

  • The handler function decorated with @mcp.tool(), which registers and implements the get_instagram_posts tool. It makes a GET request to the Metricool API to retrieve Instagram posts within a specified date range for a given blog ID.
    @mcp.tool()
    async def get_instagram_posts(init_date: str, end_date: str, blog_id: int) -> str | dict[str, Any]:
        """
        Get the list of Instagram Posts from your Metricool 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/instagram?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 Instagram Posts")
    
        return response

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/metricool/mcp-metricool'

If you have feedback or need assistance with the MCP directory API, please join our Discord server