Skip to main content
Glama

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

TableJSON Schema
NameRequiredDescriptionDefault
descriptionNo
isPublicNo
nameYesName for the new playlist
tokenYesSpotify access token for authentication

Implementation Reference

  • 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 ); },
  • 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"), }),
  • 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, };
  • 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 ); }

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/latiftplgu/Spotify-OAuth-MCP-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server