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.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "get_genres"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
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)