create_playlist
Create a new Spotify playlist with a name, optional description, and public or private visibility settings.
Instructions
Create a new playlist
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Playlist name | |
| description | No | Playlist description (optional) | |
| public | No | Whether the playlist should be public (default: true) |
Implementation Reference
- src/index.ts:479-499 (handler)Handler for create_playlist tool: fetches user data from Spotify API, then creates a new playlist via POST request to /users/{userId}/playlists with name, description, and public visibility parameters, returning the created playlist details.
case "create_playlist": { const userData = await spotifyRequest("/me"); const playlistData = await spotifyRequest( `/users/${userData.id}/playlists`, "POST", { name: args.name, description: args.description || "", public: args.public !== false, } ); return { content: [ { type: "text", text: `📝 Playlist created!\n\nName: ${playlistData.name}\nID: ${playlistData.id}\nURL: ${playlistData.external_urls.spotify}`, }, ], }; } - src/index.ts:196-218 (registration)Registration of create_playlist tool with MCP server, including the input schema defining three properties: name (required string), description (optional string), and public (optional boolean with default true).
{ name: "create_playlist", description: "Create a new playlist", inputSchema: { type: "object", properties: { name: { type: "string", description: "Playlist name", }, description: { type: "string", description: "Playlist description (optional)", }, public: { type: "boolean", description: "Whether the playlist should be public (default: true)", default: true, }, }, required: ["name"], }, },