Skip to main content
Glama
mikeysrecipes

TIDAL MCP: My Custom Picks

get_user_playlists

Retrieve and display your TIDAL playlists, showing titles, track counts, and last updated dates for organized music collection management.

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

  • MCP tool handler decorated with @mcp.tool(). Checks authentication status and proxies the request to the Flask backend API (/api/playlists) to retrieve the user's TIDAL 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)}"
            }
  • Flask route handler that implements the core logic: authenticates via decorator, fetches user playlists using TIDAL BrowserSession, formats data with URLs, sorts by last_updated descending, and returns JSON.
    @app.route('/api/playlists', methods=['GET'])
    @requires_tidal_auth
    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 effectively describes key behaviors: it retrieves data (read operation), returns playlists sorted by last updated date (most recent first), and implies it's a safe read-only function. However, it doesn't mention potential limitations like rate limits, authentication requirements, or error conditions.

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 appropriately front-loaded with the core purpose, but includes extensive usage examples and processing instructions that could be streamlined. While informative, some sections (like the detailed 'When processing the results' list) might be better handled by the agent's general capabilities rather than tool documentation.

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?

Given the tool's simplicity (0 parameters, no annotations, no output schema), the description provides good contextual completeness. It explains what the tool does, when to use it, and what to expect from the output. The main gap is the lack of output schema, but the description compensates by describing the return format.

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, so the baseline is 4. The description appropriately doesn't discuss parameters since none exist, focusing instead on the tool's purpose and output behavior.

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

Purpose5/5

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

The description clearly states the specific action ('fetches') and resource ('user's playlists from their TIDAL account'), distinguishing it from sibling tools like get_favorite_tracks or get_playlist_tracks. It precisely defines what the tool does without being vague or tautological.

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 guidance on when to use this tool with multiple example user queries (e.g., 'Show me my playlists', 'List my TIDAL playlists'). It clearly distinguishes this as the tool for viewing/list operations versus sibling tools for creation, deletion, or other playlist-related actions.

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

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