get_viewed_episodes
Retrieve watched episodes for a TV show using its ID to track viewing progress and manage watch history.
Instructions
Retrieves the viewed episodes of a TV show by its ID. :param myshows_item_id: The ID of the TV show to retrieve episodes for. :return: A dictionary containing the episodes of the TV show.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| myshows_item_id | Yes |
Implementation Reference
- src/myshows_mcp/server.py:63-70 (handler)The MCP tool handler for 'get_viewed_episodes', decorated with @mcp.tool() for registration and @tool_handler for common error handling. It delegates the logic to the MyShowsAPI client.@mcp.tool() @tool_handler async def get_viewed_episodes(myshows_item_id: int): """Retrieves the viewed episodes of a TV show by its ID. :param myshows_item_id: The ID of the TV show to retrieve episodes for. :return: A dictionary containing the episodes of the TV show. """ return await api_client.get_viewed_tv_episodes(myshows_item_id=myshows_item_id)
- Supporting API client method that makes the JSON-RPC call to 'profile.Episodes' to fetch viewed episodes for the given show ID.async def get_viewed_tv_episodes(self, myshows_item_id: int): """Get viewed tv show's episodes :param myshows_item_id: The ID of the TV show to retrieve episodes for. :return: A dictionary containing the episodes of the TV show. """ return await self._make_request( "profile.Episodes", params={"showId": int(myshows_item_id)}, id=96 )