get_user_playlists
Retrieve all Spotify playlists you own or follow to manage your music library, create interfaces, analyze listening habits, and organize collections.
Instructions
Retrieve all playlists that the user owns, follows, or has access to in their Spotify library.
🎯 USE CASES: • Display user's complete playlist collection in applications • Create playlist management interfaces and organizers • Backup playlist metadata and track relationships • Build playlist analytics and listening habit insights • Implement playlist search and filtering systems
📝 WHAT IT RETURNS: • Complete list of user's playlists (owned and followed) • Playlist names, descriptions, and artwork • Creator information and follower counts • Track counts, durations, and last modification dates • Public/private status and collaborative permissions
🔍 EXAMPLES: • "Show me all my playlists" • "Get my playlist collection with 50 items" • "List all playlists I follow and created" • "What playlists do I have in my library?"
📊 PLAYLIST ORGANIZATION: • Includes both created and followed playlists • Shows ownership and collaboration status • Perfect for playlist management dashboards • Great for discovering forgotten playlists • Useful for library cleanup and organization
💡 MANAGEMENT TIPS: • Regular review helps maintain organized library • Check for duplicate or outdated playlists • Identify collaborative playlists for group management • Monitor follower growth on public playlists
⚠️ REQUIREMENTS: • Valid Spotify access token with playlist-read-private scope • User must have at least one playlist in their library
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| token | Yes | Spotify access token for authentication | |
| limit | No |
Implementation Reference
- src/mcp/tools/playlists.ts:93-96 (handler)The handler function for the 'get_user_playlists' MCP tool, which extracts arguments and delegates to SpotifyService.getUserPlaylistshandler: async (args: any, spotifyService: SpotifyService) => { const { token, limit = 20 } = args; return await spotifyService.getUserPlaylists(token, limit); },
- src/mcp/tools/playlists.ts:89-92 (schema)Zod schema definition for input parameters (token and optional limit) of the get_user_playlists toolschema: createSchema({ token: commonSchemas.token(), limit: commonSchemas.limit(1, 50, 20), }),
- src/mcp/tools/index.ts:22-36 (registration)Registration of all tools including playlistTools (containing get_user_playlists) into the central allTools registry used by ToolRegistrarexport const allTools: ToolsRegistry = { ...albumTools, ...artistTools, ...trackTools, ...playlistTools, ...playbackTools, ...userTools, ...searchTools, };
- src/spotify.ts:493-502 (helper)SpotifyService helper method that makes the API request to Spotify's /me/playlists endpoint to fetch the user's playlistsasync getUserPlaylists( token: string, limit: number = 20 ): Promise<PagingObject<SpotifyPlaylist>> { return await this.makeRequest<PagingObject<SpotifyPlaylist>>( "me/playlists", token, { limit } ); }
- src/mcp/tools/index.ts:42-44 (registration)ToolRegistrar constructor that initializes with allTools registry containing get_user_playlists and injects SpotifyService for handlersconstructor(spotifyService: SpotifyService) { this.tools = allTools; this.spotifyService = spotifyService;