Skip to main content
Glama
yuhuacheng

TIDAL MCP: My Custom Picks

get_favorite_tracks

Retrieve your saved favorite tracks from your TIDAL account to view or manage your preferred music collection.

Instructions

Retrieves tracks from the user's TIDAL account favorites.

USE THIS TOOL WHENEVER A USER ASKS FOR:
- "What are my favorite tracks?"
- "Show me my TIDAL favorites"
- "What music do I have saved?"
- "Get my favorite songs"
- Any request to view their saved/favorite tracks

This function retrieves the user's favorite tracks from TIDAL.

Args:
    limit: Maximum number of tracks to retrieve (default: 20, note it should be large enough by default unless specified otherwise).

Returns:
    A dictionary containing track information including track ID, title, artist, album, and duration.
    Returns an error message if not authenticated or if retrieval fails.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNo

Implementation Reference

  • The primary handler for the 'get_favorite_tracks' tool. This function is decorated with @mcp.tool(), which registers it as an MCP tool. It authenticates the user, calls the backend Flask API to retrieve favorite tracks, and handles errors appropriately.
    @mcp.tool()
    def get_favorite_tracks(limit: int = 20) -> dict:
        """
        Retrieves tracks from the user's TIDAL account favorites.
        
        USE THIS TOOL WHENEVER A USER ASKS FOR:
        - "What are my favorite tracks?"
        - "Show me my TIDAL favorites"
        - "What music do I have saved?"
        - "Get my favorite songs"
        - Any request to view their saved/favorite tracks
        
        This function retrieves the user's favorite tracks from TIDAL.
        
        Args:
            limit: Maximum number of tracks to retrieve (default: 20, note it should be large enough by default unless specified otherwise).
        
        Returns:
            A dictionary containing track information including track ID, title, artist, album, and duration.
            Returns an error message if not authenticated or if retrieval fails.
        """
        try:
            # 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 favorite tracks. Please use the tidal_login() function."
                }
                
            # Call your Flask endpoint to retrieve tracks with the specified limit
            response = requests.get(f"{FLASK_APP_URL}/api/tracks", params={"limit": limit})
            
            # Check if the request was successful
            if response.status_code == 200:
                return response.json()
            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 tracks: {error_data.get('error', 'Unknown error')}"
                }
        except Exception as e:
            return {
                "status": "error",
                "message": f"Failed to connect to TIDAL tracks service: {str(e)}"
            }
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: authentication requirements ('if not authenticated'), error handling ('if retrieval fails'), and the default limit behavior. However, it doesn't mention rate limits, pagination, or whether this is a read-only operation.

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

Conciseness4/5

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

The description is well-structured with clear sections (purpose, usage guidelines, function description, args, returns). While slightly longer than minimal, every section adds value. The information is front-loaded with the core purpose in the first sentence.

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 single-parameter read operation with no annotations or output schema, the description provides comprehensive context: clear purpose, usage guidelines, parameter semantics, return format details, and error conditions. The main gap is the lack of explicit read-only declaration, though this is implied by 'retrieves'.

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?

With 0% schema description coverage and only one parameter, the description provides good semantic context for the 'limit' parameter, explaining its purpose, default value, and usage guidance ('should be large enough by default unless specified otherwise'). This compensates well for the lack of schema documentation.

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 ('retrieves tracks') and resource ('from the user's TIDAL account favorites'), distinguishing it from sibling tools like get_playlist_tracks or get_user_playlists which target different resources. The opening sentence provides a complete, unambiguous purpose statement.

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 includes an explicit 'USE THIS TOOL WHENEVER' section with multiple example user queries, providing clear guidance on when to invoke this tool. It distinguishes this tool from alternatives by focusing specifically on favorite tracks rather than playlists or recommendations.

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