modify_playlist_details
Update Spotify playlist details, including name, description, and visibility, using the playlist ID to manage and customize your music collections.
Instructions
Modify playlist details.
Args:
playlist_id: Playlist ID
name: New playlist name (optional)
description: New playlist description (optional)
public: Whether playlist should be public (optional)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| description | No | ||
| name | No | ||
| playlist_id | Yes | ||
| public | No |
Implementation Reference
- The handler function decorated with @mcp.tool() that implements the logic to modify Spotify playlist details (name, description, public status) using the Spotify API.@mcp.tool() @log_tool_execution def modify_playlist_details( playlist_id: str, name: str | None = None, description: str | None = None, public: bool | None = None, ) -> dict[str, str]: """Modify playlist details. Args: playlist_id: Playlist ID name: New playlist name (optional) description: New playlist description (optional) public: Whether playlist should be public (optional) """ try: if not name and not description and public is None: raise ValueError( "At least one of name, description, or public must be provided" ) updates = [] if name: updates.append(f"name='{name}'") if description: updates.append(f"description='{description}'") if public is not None: updates.append(f"public={public}") logger.info(f"📋 Modifying playlist {playlist_id}: {', '.join(updates)}") spotify_client.playlist_change_details( playlist_id, name=name, description=description, public=public ) return {"status": "success", "message": "Playlist details updated successfully"} except SpotifyException as e: raise convert_spotify_error(e) from e