search_shows
Search for TV shows and movies on MyShows using keywords, with optional filters for year 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 |
|---|---|---|---|
| page | No | ||
| query | Yes | ||
| year | No |
Implementation Reference
- src/myshows_mcp/server.py:31-40 (handler)Handler function for the MCP 'search_shows' tool. Registered via @mcp.tool() decorator and wrapped with @tool_handler for error handling. Delegates execution to the MyShowsAPI client's search_shows method.@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)
- Supporting utility in MyShowsAPI class that performs the actual JSON-RPC API call to 'shows.GetCatalog' for searching shows on MyShows.me.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, }, )