Skip to main content
Glama
mikeysrecipes

TIDAL MCP: My Custom Picks

get_favorite_tracks

Retrieve your favorite tracks from TIDAL with this tool, providing title, artist, album, and duration. Use it to view saved music or manage playlists directly in your account.

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 handler function for the 'get_favorite_tracks' tool, decorated with @mcp.tool() which also serves as the registration. It handles authentication check and proxies the request to the backend Flask API at /api/tracks to retrieve the user's favorite tracks.
    @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)}" }
  • The @mcp.tool() decorator registers the get_favorite_tracks function as an MCP tool.
    @mcp.tool()

Other Tools

Related 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