Skip to main content
Glama
keenanbass1

TIDAL MCP Server

by keenanbass1

remove_album_from_favorites

Remove an album from your TIDAL favorites list by providing the album ID to manage your saved music collection.

Instructions

Remove an album from user's favorites.

Args: album_id: ID of the album to remove from favorites

Returns: Success status and confirmation

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
album_idYes

Implementation Reference

  • The @mcp.tool()-decorated handler function that executes the logic to remove an album from the user's TIDAL favorites using the tidalapi session.
    @mcp.tool()
    async def remove_album_from_favorites(album_id: str) -> RemoveFromFavoritesResult:
        """
        Remove an album from user's favorites.
    
        Args:
            album_id: ID of the album to remove from favorites
    
        Returns:
            Success status and confirmation
        """
        if not await ensure_authenticated():
            raise ToolError("Not authenticated. Please run the 'login' tool first.")
    
        try:
            album_id_int = int(album_id)
            await anyio.to_thread.run_sync(
                session.user.favorites.remove_album, album_id_int
            )
    
            return RemoveFromFavoritesResult(
                status="success",
                item_id=album_id,
                item_type="album",
                message=f"Album {album_id} removed from favorites",
            )
        except ValueError:
            raise ToolError(f"Invalid album ID format: {album_id}")
        except Exception as e:
            raise ToolError(f"Failed to remove album from favorites: {str(e)}")
  • Pydantic BaseModel defining the structured output schema for remove_album_from_favorites and similar tools, including status, item_id, item_type, and message.
    class RemoveFromFavoritesResult(BaseModel):
        """Result of removing an item from favorites."""
    
        status: str = Field(description="Operation status (success/error)")
        item_id: str = Field(description="ID of the item removed from favorites")
        item_type: str = Field(description="Type of item (track/album/artist)")
        message: str = Field(description="Status message")
  • The @mcp.tool() decorator registers this function as an MCP tool named 'remove_album_from_favorites' with FastMCP.
    @mcp.tool()
    async def remove_album_from_favorites(album_id: str) -> RemoveFromFavoritesResult:
        """
        Remove an album from user's favorites.
    
        Args:
            album_id: ID of the album to remove from favorites
    
        Returns:
            Success status and confirmation
        """
        if not await ensure_authenticated():
            raise ToolError("Not authenticated. Please run the 'login' tool first.")
    
        try:
            album_id_int = int(album_id)
            await anyio.to_thread.run_sync(
                session.user.favorites.remove_album, album_id_int
            )
    
            return RemoveFromFavoritesResult(
                status="success",
                item_id=album_id,
                item_type="album",
                message=f"Album {album_id} removed from favorites",
            )
        except ValueError:
            raise ToolError(f"Invalid album ID format: {album_id}")
        except Exception as e:
            raise ToolError(f"Failed to remove album from favorites: {str(e)}")

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