delete_playlist
Remove a playlist from your TIDAL account by providing its ID to declutter your music library and manage your saved content.
Instructions
Delete a playlist from user's account.
Args: playlist_id: ID of the playlist to delete
Returns: Confirmation of deletion
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| playlist_id | Yes |
Implementation Reference
- src/tidal_mcp/server.py:740-771 (handler)The handler function that implements the delete_playlist tool. It checks authentication, retrieves the playlist object using session.playlist(playlist_id), deletes it with playlist.delete(), and returns a DeletePlaylistResult.@mcp.tool() async def delete_playlist(playlist_id: str) -> DeletePlaylistResult: """ Delete a playlist from user's account. Args: playlist_id: ID of the playlist to delete Returns: Confirmation of deletion """ if not await ensure_authenticated(): raise ToolError("Not authenticated. Please run the 'login' tool first.") try: playlist = await anyio.to_thread.run_sync(session.playlist, playlist_id) if not playlist: raise ToolError(f"Playlist with ID '{playlist_id}' not found") playlist_name = playlist.name await anyio.to_thread.run_sync(playlist.delete) return DeletePlaylistResult( status="success", playlist_id=playlist_id, message=f"Deleted playlist '{playlist_name}'", ) except ToolError: raise except Exception as e: raise ToolError(f"Failed to delete playlist: {str(e)}")
- src/tidal_mcp/models.py:168-174 (schema)Pydantic BaseModel defining the return schema for the delete_playlist tool, including status, playlist_id, and message fields.class DeletePlaylistResult(BaseModel): """Result of deleting a playlist.""" status: str = Field(description="Operation status (success/error)") playlist_id: str = Field(description="ID of the deleted playlist") message: str = Field(description="Status message")
- src/tidal_mcp/server.py:82-82 (registration)The tool is listed in the server instructions/docstring, indicating it is available.- delete_playlist: Delete a playlist
- src/tidal_mcp/server.py:19-45 (schema)Import of the DeletePlaylistResult schema used by the delete_playlist handler.from .models import ( # Core entities Track, Album, Artist, Playlist, # List responses TrackList, AlbumList, ArtistList, PlaylistList, PlaylistTracks, AlbumTracks, # Detail responses ArtistDetails, AlbumDetails, RadioTracks, # Operation results AuthResult, CreatePlaylistResult, AddTracksResult, RemoveTracksResult, UpdatePlaylistResult, DeletePlaylistResult, AddToFavoritesResult, RemoveFromFavoritesResult, )