get_upcoming_releases
Retrieve upcoming movie and TV releases from IMDb for specific countries with paginated results.
Instructions
Get the upcoming releases from IMDb with pagination. Args: country_code: The country code to get the upcoming releases for. type: The type of the upcoming releases to get. Possible values: "TV", "MOVIE". start: The starting index (0-based) to retrieve releases from. Returns: JSON object containing 5 upcoming releases starting from the specified index.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| country_code | Yes | ||
| type | Yes | ||
| start | Yes |
Implementation Reference
- src/imdb_mcp_server/tools.py:280-294 (handler)The main handler function for the 'get_upcoming_releases' tool. It is decorated with @mcp.tool() for automatic registration. Fetches upcoming releases data from the IMDb API using the provided country_code and type parameters, handles pagination with the start index using the paginated_response helper, and returns a JSON string of the results or an error message if data is unavailable.@mcp.tool() async def get_upcoming_releases(country_code: str, type: str, start: int, ctx: Context) -> str: """Get the upcoming releases from IMDb with pagination. Args: country_code: The country code to get the upcoming releases for. type: The type of the upcoming releases to get. Possible values: "TV", "MOVIE". start: The starting index (0-based) to retrieve releases from. Returns: JSON object containing 5 upcoming releases starting from the specified index. """ upcoming_releases_url = f"{BASE_URL}/upcoming-releases" upcoming_releases_data = await make_imdb_request(upcoming_releases_url, {"countryCode": country_code, "type": type}, ctx) if not upcoming_releases_data: return "Unable to fetch upcoming releases data." return json.dumps(paginated_response(upcoming_releases_data, start, len(upcoming_releases_data)), indent=4)