modify_playlist_details
Update a Spotify playlist's name, description, or public status by providing its playlist ID.
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
| Name | Required | Description | Default |
|---|---|---|---|
| playlist_id | Yes | ||
| name | No | ||
| description | No | ||
| public | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- The tool handler function that modifies playlist details. Decorated with @mcp.tool() and @log_tool_execution. Validates at least one field is provided, then calls spotify_client.playlist_change_details.
@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 - The Client.update_playlist_details helper method that wraps the low-level Spotipy call to playlist_change_details with logging and error handling.
def update_playlist_details( self, playlist_id: str, name: str | None = None, description: str | None = None, public: bool | None = None, ) -> None: """Update a playlist's details""" try: self.logger.info( f"Updating playlist {playlist_id} with name: {name}, description: {description}, public: {public}" ) self.sp.playlist_change_details( playlist_id, name=name, description=description, public=public ) self.logger.info( f"Successfully updated playlist details for ID: {playlist_id}" ) except Exception as e: self.logger.error(f"Error updating playlist: {str(e)}", exc_info=True) raise - src/spotify_mcp/fastmcp_server.py:700-700 (registration)Tool registration via the @mcp.tool() decorator, which registers 'modify_playlist_details' with the FastMCP server.
@mcp.tool()