get_top_rated_malayalam_movies
Retrieve top-rated Malayalam movies from IMDb, returning 5 films starting from any specified index in the ranked list.
Instructions
Top 50 Malayalam movies as rated by the IMDb users. Args: start: The starting index (0-based) to retrieve movies from. Returns: JSON object containing 5 top rated Malayalam 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:312-327 (handler)The handler function decorated with @mcp.tool(), which registers and implements the tool. Fetches data from IMDb API endpoint for top-rated Malayalam movies, paginates the 'items', and returns formatted JSON.@mcp.tool() async def get_top_rated_malayalam_movies(start: int, ctx: Context) -> str: """Top 50 Malayalam movies as rated by the IMDb users. Args: start: The starting index (0-based) to retrieve movies from. Returns: JSON object containing 5 top rated Malayalam movies starting from the specified index. """ top_rated_malayalam_movies_url = f"{BASE_URL}/india/top-rated-malayalam-movies" top_rated_malayalam_movies_data = await make_imdb_request(top_rated_malayalam_movies_url, {}, ctx) if not top_rated_malayalam_movies_data: return "Unable to fetch top rated Malayalam movies data." # Use paginated response helper with fixed page size movies = top_rated_malayalam_movies_data.get("items", []) return json.dumps(paginated_response(movies, start, len(movies)), indent=4)