add_track_to_favorites
Save a track to your TIDAL favorites list. Use this tool to mark songs you enjoy for easy access and personalized recommendations.
Instructions
Add a track to user's favorites (like a track).
Args: track_id: ID of the track to add to favorites
Returns: Success status and confirmation
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| track_id | Yes |
Implementation Reference
- src/tidal_mcp/server.py:436-466 (handler)Handler function decorated with @mcp.tool() which registers and implements the tool. Calls TIDAL API to add track to user favorites.@mcp.tool() async def add_track_to_favorites(track_id: str) -> AddToFavoritesResult: """ Add a track to user's favorites (like a track). Args: track_id: ID of the track to add to favorites Returns: Success status and confirmation """ if not await ensure_authenticated(): raise ToolError("Not authenticated. Please run the 'login' tool first.") try: track_id_int = int(track_id) await anyio.to_thread.run_sync( session.user.favorites.add_track, track_id_int ) return AddToFavoritesResult( status="success", item_id=track_id, item_type="track", message=f"Track {track_id} added to favorites", ) except ValueError: raise ToolError(f"Invalid track ID format: {track_id}") except Exception as e: raise ToolError(f"Failed to add track to favorites: {str(e)}")
- src/tidal_mcp/models.py:176-183 (schema)Pydantic model for the tool's output schema, defining the structure of the success response.class AddToFavoritesResult(BaseModel): """Result of adding an item to favorites.""" status: str = Field(description="Operation status (success/error)") item_id: str = Field(description="ID of the item added to favorites") item_type: str = Field(description="Type of item (track/album/artist)") message: str = Field(description="Status message")
- src/tidal_mcp/server.py:71-72 (registration)Tool mentioned in server instructions, part of the MCP server description for tool discovery.- add_track_to_favorites: Like a track - remove_track_from_favorites: Unlike a track