get_genres
Retrieve a complete list of all available movie and TV show genres from IMDb's comprehensive database for content categorization and filtering.
Instructions
Get all genres. Returns: JSON object containing all genres.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/imdb_mcp_server/tools.py:160-170 (handler)The main handler function for the 'get_genres' MCP tool. It makes an API request to fetch all genres from IMDb and returns them as a JSON string.@mcp.tool() async def get_genres(ctx: Context) -> str: """Get all genres. Returns: JSON object containing all genres. """ genres_url = f"{BASE_URL}/genres" genres_data = await make_imdb_request(genres_url, {}, ctx) if not genres_data: return "Unable to fetch genres data." return json.dumps(genres_data, indent=4)