get_twitch_videos
Retrieve Twitch videos from your Metricool account by specifying a date range and blog ID. Simplify data extraction for analysis or reporting.
Instructions
Get the list of Twitch Videos 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:326-344 (handler)Handler function decorated with @mcp.tool() which registers it as an MCP tool. Implements logic to fetch Twitch videos data from Metricool API via HTTP GET request.@mcp.tool() async def get_twitch_videos(init_date: str, end_date: str, blog_id: int) -> str | dict[str, Any]: """ Get the list of Twitch Videos 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/twitch/videos?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 Twitch Videos") return response
- src/mcp_metricool/tools/tools.py:326-344 (registration)The @mcp.tool() decorator registers the get_twitch_videos function as an MCP tool in the FastMCP server.@mcp.tool() async def get_twitch_videos(init_date: str, end_date: str, blog_id: int) -> str | dict[str, Any]: """ Get the list of Twitch Videos 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/twitch/videos?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 Twitch Videos") return response
- Docstring provides input schema description for the tool parameters: init_date (YYYYMMDD), end_date (YYYYMMDD), blog_id (int). Return type: str | dict[str, Any].""" Get the list of Twitch Videos 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. """
- src/mcp_metricool/tools/tools.py:6-6 (helper)Imports make_get_request utility used to perform the API request in the handler.from mcp_metricool.utils.utils import make_get_request