Skip to main content
Glama
keenanbass1

TIDAL MCP Server

by keenanbass1

get_favorite_artists

Retrieve a user's followed artists from TIDAL music service to access their favorite musicians and build personalized music experiences.

Instructions

Get user's favorite (followed) artists from TIDAL.

Args: limit: Maximum artists to retrieve (default: 50)

Returns: List of followed artists

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNo

Implementation Reference

  • The main handler function for the 'get_favorite_artists' tool. It fetches the user's followed artists from TIDAL using the tidalapi library, authenticates if needed, and returns a structured ArtistList.
    @mcp.tool()
    async def get_favorite_artists(limit: int = 50) -> ArtistList:
        """
        Get user's favorite (followed) artists from TIDAL.
    
        Args:
            limit: Maximum artists to retrieve (default: 50)
    
        Returns:
            List of followed artists
        """
        if not await ensure_authenticated():
            raise ToolError("Not authenticated. Please run the 'login' tool first.")
    
        try:
            favorites = await anyio.to_thread.run_sync(
                lambda: session.user.favorites.artists(limit=limit)
            )
    
            artists = []
            for artist in favorites:
                artists.append(
                    Artist(
                        id=str(artist.id),
                        name=artist.name,
                        url=f"https://tidal.com/browse/artist/{artist.id}",
                    )
                )
    
            return ArtistList(status="success", count=len(artists), artists=artists)
        except Exception as e:
            raise ToolError(f"Failed to get favorite artists: {str(e)}")
  • Pydantic model defining the structured output schema returned by the get_favorite_artists tool, including status, count, and list of Artist objects.
    class ArtistList(BaseModel):
        """List of artists with metadata."""
    
        status: str = Field(description="Operation status (success/error)")
        query: Optional[str] = Field(None, description="Search query used (for search results)")
        count: int = Field(description="Number of artists returned")
        artists: List[Artist] = Field(description="List of artist objects")
  • Base Pydantic model for individual Artist objects used within ArtistList.
    class Artist(BaseModel):
        """Structured representation of a TIDAL artist."""
    
        id: str = Field(description="Unique TIDAL artist ID")
        name: str = Field(description="Artist name")
        url: str = Field(description="TIDAL web URL for the artist")
  • Tool description in the server instructions docstring, which serves as informal registration documentation listing all available tools.
    - get_favorite_artists: Get your followed artists

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/keenanbass1/tidal-mcp'

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