Skip to main content
Glama

get_favorite_tracks

Retrieve your favorite tracks from your TIDAL account with detailed information including title, artist, album, and duration. Use this tool to view saved songs or answer queries about your music preferences. Requires authentication for access.

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' MCP tool. Decorated with @mcp.tool() for registration. Checks user authentication via Flask API and retrieves favorite tracks from TIDAL backend with optional limit parameter. Includes input/output schema in docstring and type hints.
    @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)}" }

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

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