Skip to main content
Glama
yuhuacheng

TIDAL MCP: My Custom Picks

get_user_playlists

Retrieve your TIDAL playlists to view music collections, track counts, and recent updates. Organize and access your saved playlists from your account.

Instructions

Fetches the user's playlists from their TIDAL account.

USE THIS TOOL WHENEVER A USER ASKS FOR:
- "Show me my playlists"
- "List my TIDAL playlists"
- "What playlists do I have?"
- "Get my music collections"
- Any request to view or list their TIDAL playlists

This function retrieves the user's playlists from TIDAL and returns them sorted
by last updated date (most recent first).

When processing the results of this tool:
1. Present the playlists in a clear, organized format
2. Include key information like title, track count, and the TIDAL URL for each playlist
3. Mention when each playlist was last updated if available
4. If the user has many playlists, focus on the most recently updated ones unless specified otherwise

Returns:
    A dictionary containing the user's playlists sorted by last updated date

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Primary MCP tool handler and registration for get_user_playlists. This @mcp.tool()-decorated function implements the tool logic by checking authentication status and proxying the GET request to the Tidal Flask API endpoint /api/playlists to retrieve the user's playlists.
    @mcp.tool()
    def get_user_playlists() -> dict:
        """
        Fetches the user's playlists from their TIDAL account.
        
        USE THIS TOOL WHENEVER A USER ASKS FOR:
        - "Show me my playlists"
        - "List my TIDAL playlists"
        - "What playlists do I have?"
        - "Get my music collections"
        - Any request to view or list their TIDAL playlists
        
        This function retrieves the user's playlists from TIDAL and returns them sorted
        by last updated date (most recent first).
        
        When processing the results of this tool:
        1. Present the playlists in a clear, organized format
        2. Include key information like title, track count, and the TIDAL URL for each playlist
        3. Mention when each playlist was last updated if available
        4. If the user has many playlists, focus on the most recently updated ones unless specified otherwise
        
        Returns:
            A dictionary containing the user's playlists sorted by last updated date
        """
        # First, check if the user is authenticated
        auth_check = requests.get(f"{FLASK_APP_URL}/api/auth/status")
        auth_data = auth_check.json()
        
        if not auth_data.get("authenticated", False):
            return {
                "status": "error",
                "message": "You need to login to TIDAL first before I can fetch your playlists. Please use the tidal_login() function."
            }
        
        try:
            # Call the Flask endpoint to retrieve playlists with the specified limit
            response = requests.get(f"{FLASK_APP_URL}/api/playlists")
            
            # Check if the request was successful
            if response.status_code == 200:
                return {
                    "status": "success",
                    "playlists": response.json().get("playlists", []),
                    "playlist_count": len(response.json().get("playlists", []))
                }
            elif response.status_code == 401:
                return {
                    "status": "error",
                    "message": "Not authenticated with TIDAL. Please login first using tidal_login()."
                }
            else:
                error_data = response.json()
                return {
                    "status": "error",
                    "message": f"Failed to retrieve playlists: {error_data.get('error', 'Unknown error')}"
                }
        except Exception as e:
            return {
                "status": "error",
                "message": f"Failed to connect to TIDAL playlists service: {str(e)}"
            }
  • Core backend implementation of get_user_playlists logic in the Flask route /api/playlists (GET). Fetches playlists using session.user.playlists(), formats playlist data with details like ID, title, description, track count, and URL, sorts by last_updated descending, and returns JSON.
    def get_user_playlists(session: BrowserSession):
        """
        Get the user's playlists from TIDAL.
        """
        try:        
            # Get user playlists
            playlists = session.user.playlists()
            
            # Format playlist data
            playlist_list = []
            for playlist in playlists:
                playlist_info = {
                    "id": playlist.id,
                    "title": playlist.name,
                    "description": playlist.description if hasattr(playlist, 'description') else "",
                    "created": playlist.created if hasattr(playlist, 'created') else None,
                    "last_updated": playlist.last_updated if hasattr(playlist, 'last_updated') else None,
                    "track_count": playlist.num_tracks if hasattr(playlist, 'num_tracks') else 0,
                    "duration": playlist.duration if hasattr(playlist, 'duration') else 0,
                    "url": f"https://tidal.com/playlist/{playlist.id}"
                }
                playlist_list.append(playlist_info)
            
            # Sort playlists by last_updated in descending order
            sorted_playlists = sorted(
                playlist_list, 
                key=lambda x: x.get('last_updated', ''), 
                reverse=True
            )
    
            return jsonify({"playlists": sorted_playlists})
        except Exception as e:
            return jsonify({"error": f"Error fetching playlists: {str(e)}"}), 500
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It successfully describes key behaviors: that it retrieves playlists sorted by last updated date (most recent first), and provides guidance on how to process results. It doesn't mention authentication requirements, rate limits, or error conditions, but covers the core operational behavior adequately.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with clear sections for purpose, usage guidelines, behavioral details, and return format. However, it includes overly specific implementation advice ('When processing the results...') that belongs in agent instructions rather than tool description. Some sentences don't earn their place in a tool definition context.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a read-only tool with no parameters and no output schema, the description provides good contextual completeness. It explains what the tool does, when to use it, how results are sorted, and what information is returned. The main gap is the lack of authentication context (TIDAL account requirement), but otherwise covers the essential context for this tool's complexity level.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has 0 parameters with 100% schema description coverage. The description appropriately doesn't waste space discussing non-existent parameters. The baseline for 0 parameters is 4, and the description meets this by focusing on what the tool does rather than parameter documentation.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Fetches the user's playlists from their TIDAL account.' This is a specific verb+resource combination that distinguishes it from sibling tools like get_favorite_tracks or get_playlist_tracks. However, it doesn't explicitly differentiate from create_tidal_playlist or delete_tidal_playlist in terms of read vs write operations.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit usage guidelines with a dedicated section: 'USE THIS TOOL WHENEVER A USER ASKS FOR:' followed by multiple example queries. This gives clear context for when to use this tool versus alternatives like get_favorite_tracks or recommend_tracks for different types of music content requests.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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

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