Skip to main content
Glama
client.py1.57 kB
"""User client for user-specific data.""" from config.endpoints import TRAKT_ENDPOINTS from models.types import UserWatchedMovie, UserWatchedShow from utils.api.error_types import AuthenticationRequiredError from utils.api.errors import handle_api_errors from ..auth import AuthClient class UserClient(AuthClient): """Client for handling user-specific operations that require authentication.""" @handle_api_errors async def get_user_watched_shows(self) -> list[UserWatchedShow]: """Get shows watched by the authenticated user. Returns: list[UserWatchedShow]: Watched shows. Raises: AuthenticationRequiredError: If the client is not authenticated. """ if not self.is_authenticated(): raise AuthenticationRequiredError("get user watched shows") return await self._make_typed_list_request( TRAKT_ENDPOINTS["user_watched_shows"], response_type=UserWatchedShow ) @handle_api_errors async def get_user_watched_movies(self) -> list[UserWatchedMovie]: """Get movies watched by the authenticated user. Returns: list[UserWatchedMovie]: Watched movies. Raises: AuthenticationRequiredError: If the client is not authenticated. """ if not self.is_authenticated(): raise AuthenticationRequiredError("get user watched movies") return await self._make_typed_list_request( TRAKT_ENDPOINTS["user_watched_movies"], response_type=UserWatchedMovie )

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/wwiens/trakt_mcpserver'

If you have feedback or need assistance with the MCP directory API, please join our Discord server