get_scheduled_posts
Retrieve scheduled posts for a Metricool brand account within a specified date range and timezone. Extend search range if needed to access unpublished posts efficiently.
Instructions
Get the list of scheduled posts for a specific Metricool brand (blog_id). Only retrieves posts that are scheduled (not yet published). If the user doesn't provide a blog_id, ask for it.
Args: blog_id: Blog id of the Metricool brand account. start: Start date of the period to get the data. The format is YYYY-MM-DD end: End date of the period to get the data. The format is YYYY-MM-DD timezone: Timezone of the post. The format is "Europe%2FMadrid". Use the timezone of the user extracted from the get_brands tool. extendedRange: When it's true, search date range is expanded one day after and one day before. Default value is false.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| blog_id | Yes | ||
| end | Yes | ||
| extendedRange | Yes | ||
| start | Yes | ||
| timezone | Yes |
Implementation Reference
- src/mcp_metricool/tools/tools.py:556-577 (handler)The handler function decorated with @mcp.tool() that implements the logic for retrieving scheduled posts from the Metricool API using a GET request to the scheduler/posts endpoint.@mcp.tool() async def get_scheduled_posts(blog_id: int, start: str, end: str, timezone: str, extendedRange: bool) -> str | dict[str, Any]: """ Get the list of scheduled posts for a specific Metricool brand (blog_id). Only retrieves posts that are scheduled (not yet published). If the user doesn't provide a blog_id, ask for it. Args: blog_id: Blog id of the Metricool brand account. start: Start date of the period to get the data. The format is YYYY-MM-DD end: End date of the period to get the data. The format is YYYY-MM-DD timezone: Timezone of the post. The format is "Europe%2FMadrid". Use the timezone of the user extracted from the get_brands tool. extendedRange: When it's true, search date range is expanded one day after and one day before. Default value is false. """ url = f"{METRICOOL_BASE_URL}/v2/scheduler/posts?blogId={blog_id}&userId={METRICOOL_USER_ID}&integrationSource=MCP&start={start}T00%3A00%3A00&end={end}T23%3A59%3A59&timezone={timezone}&extendedRange={extendedRange}" response = await make_get_request(url) if not response: return "Failed to get scheduled posts" return response
- src/mcp_metricool/tools/tools.py:17-17 (registration)Initialization of the FastMCP server instance 'metricool'. All tools, including get_scheduled_posts, are registered to this instance via @mcp.tool() decorators.mcp = FastMCP("metricool")
- src/mcp_metricool/server.py:1-2 (registration)Imports the tools module which triggers the registration of all @mcp.tool() functions, including get_scheduled_posts, upon import.from .tools import tools
- Docstring providing detailed input parameter descriptions and usage instructions, serving as the tool schema.""" Get the list of scheduled posts for a specific Metricool brand (blog_id). Only retrieves posts that are scheduled (not yet published). If the user doesn't provide a blog_id, ask for it. Args: blog_id: Blog id of the Metricool brand account. start: Start date of the period to get the data. The format is YYYY-MM-DD end: End date of the period to get the data. The format is YYYY-MM-DD timezone: Timezone of the post. The format is "Europe%2FMadrid". Use the timezone of the user extracted from the get_brands tool. extendedRange: When it's true, search date range is expanded one day after and one day before. Default value is false. """