Skip to main content
Glama
keenanbass1

TIDAL MCP Server

by keenanbass1

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
NameRequiredDescriptionDefault
track_idYes

Implementation Reference

  • 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)}")
  • 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")
  • 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

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

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