search_shows
Search for TV shows and movies on MyShows using queries, optional year filters, and pagination to find specific content.
Instructions
Searches for TV shows/movies on MyShows by a query and optional year. :param query: The search query string. :param year: Optional year to filter the search results. :param page: The page number to retrieve (default is 0). :return: A dictionary containing the search results.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | ||
| year | No | ||
| page | No |
Implementation Reference
- src/myshows_mcp/server.py:31-40 (handler)The main handler function for the 'search_shows' MCP tool, including registration via @mcp.tool(), input schema via type hints and docstring, and logic delegating to the API client.@mcp.tool() @tool_handler async def search_shows(query: str, year: int | None = None, page: int = 0): """Searches for TV shows/movies on MyShows by a query and optional year. :param query: The search query string. :param year: Optional year to filter the search results. :param page: The page number to retrieve (default is 0). :return: A dictionary containing the search results. """ return await api_client.search_shows(query=query, year=year, page=page)
- Helper function in MyShowsAPI class that implements the core search logic by making a JSON-RPC call to the MyShows API 'shows.GetCatalog' method.async def search_shows( self, query: str, year: int | None = None, page: int = 0 ) -> Dict[str, Any]: """Search for TV shows/movie on MyShows by year and/or query. :param query: The search query string. :param year: Optional year to filter the search results. :param page: The page number to retrieve (default is 0). :return: A dictionary containing the search results. """ return await self._make_request( method="shows.GetCatalog", id=63, params={ "search": { "network": None, "genre": None, "country": None, "year": int(year) if year else None, "startYear": None, "endYear": None, "watching": None, "category": None, "status": None, "sort": None, "query": query, "watchStatus": None, "embed": None, "providers": None, "jwProviders": None, }, "page": int(page), "pageSize": 30, }, )