get_top_rated_indian_movies
Retrieve top-rated Indian movies from IMDb with paginated results to find highly acclaimed films from India's cinema industry.
Instructions
Top 250 rated Indian movies on IMDb with pagination. Args: start: The starting index (0-based) to retrieve movies from. Returns: JSON object containing 5 top rated Indian movies starting from the specified index.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| start | Yes |
Input Schema (JSON Schema)
{
"properties": {
"start": {
"title": "Start",
"type": "integer"
}
},
"required": [
"start"
],
"type": "object"
}
Implementation Reference
- src/imdb_mcp_server/tools.py:405-418 (handler)The main handler function for the 'get_top_rated_indian_movies' tool. It is decorated with @mcp.tool() for registration and implements the core logic: constructs the API URL, fetches data using make_imdb_request, checks for data, paginates with paginated_response, and returns formatted JSON.@mcp.tool() async def get_top_rated_indian_movies(start: int, ctx: Context) -> str: """Top 250 rated Indian movies on IMDb with pagination. Args: start: The starting index (0-based) to retrieve movies from. Returns: JSON object containing 5 top rated Indian movies starting from the specified index. """ top_rated_indian_movies_url = f"{BASE_URL}/india/top-rated-indian-movies" top_rated_indian_movies_data = await make_imdb_request(top_rated_indian_movies_url, {}, ctx) if not top_rated_indian_movies_data: return "Unable to fetch top rated Indian movies data." return json.dumps(paginated_response(top_rated_indian_movies_data, start, len(top_rated_indian_movies_data)), indent=4)