create_playlist
Create custom playlists on Spotify with specific names, descriptions, and settings for personal or collaborative use. Ideal for organizing music by theme, mood, or activity.
Instructions
Create a new custom playlist in the user's Spotify library with specified name and settings.
🎯 USE CASES: • Build themed playlists for specific moods or activities • Create event-specific music collections for parties • Organize music discoveries into curated collections • Build workout, study, or relaxation playlists • Create collaborative playlists for groups and friends
📝 WHAT IT RETURNS: • New playlist information with unique Spotify ID • Playlist URL for easy sharing and access • Creation confirmation with metadata • Empty playlist ready for track additions • Settings confirmation (public/private, collaborative)
🔍 EXAMPLES: • "Create a playlist called 'Summer Vibes 2024'" • "Make a private playlist for my workout music" • "Create 'Study Sessions' playlist with description" • "Build a collaborative playlist for our road trip"
🎵 PLAYLIST CUSTOMIZATION: • Custom name and description for context • Public or private visibility settings • Collaborative options for group contributions • Ready for immediate track additions • Perfect foundation for curated collections
💡 CREATION STRATEGIES: • Use descriptive names for easy discovery • Add detailed descriptions for context • Consider privacy settings based on content • Plan collaborative access for group playlists • Create multiple themed playlists for organization
⚠️ REQUIREMENTS: • Valid Spotify access token with playlist-modify-public/private scopes • Unique playlist name (duplicates allowed but not recommended)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| description | No | ||
| isPublic | No | ||
| name | Yes | Name for the new playlist | |
| token | Yes | Spotify access token for authentication |
Implementation Reference
- src/mcp/tools/playlists.ts:204-212 (handler)The handler function for the MCP 'create_playlist' tool. It parses arguments and calls SpotifyService.createPlaylist to perform the operation.handler: async (args: any, spotifyService: SpotifyService) => { const { token, name, description = "", isPublic = true } = args; return await spotifyService.createPlaylist( token, name, description, isPublic ); },
- src/mcp/tools/playlists.ts:192-203 (schema)The Zod input schema for the 'create_playlist' tool, defining parameters: token, name, optional description, and optional isPublic.schema: createSchema({ token: commonSchemas.token(), name: z.string().describe("Name for the new playlist"), description: z .string() .optional() .describe("Description for the playlist"), isPublic: z .boolean() .default(true) .describe("Whether the playlist should be public"), }),
- src/mcp/tools/index.ts:22-36 (registration)Registration of playlistTools (containing 'create_playlist') into the combined allTools registry, which is used by ToolRegistrar for MCP tool listing and execution.export const allTools: ToolsRegistry = { ...albumTools, ...artistTools, ...trackTools, ...playlistTools, ...playbackTools, ...userTools, ...searchTools, };
- src/spotify.ts:526-547 (helper)SpotifyService.createPlaylist method: the core implementation that calls Spotify API to create a new playlist for the authenticated user.async createPlaylist( token: string, name: string, description: string = "", isPublic: boolean = true ): Promise<SpotifyPlaylist> { const userProfile = await this.getUserProfile(token); const userId = userProfile.id; const data = { name, description, public: isPublic, }; return await this.makeRequest<SpotifyPlaylist>( `users/${userId}/playlists`, token, {}, "POST", data ); }