Skip to main content
Glama

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

TableJSON Schema
NameRequiredDescriptionDefault
tokenYesSpotify access token for authentication
limitNo

Implementation Reference

  • The handler function for the 'get_user_playlists' MCP tool, which extracts arguments and delegates to SpotifyService.getUserPlaylists
    handler: async (args: any, spotifyService: SpotifyService) => { const { token, limit = 20 } = args; return await spotifyService.getUserPlaylists(token, limit); },
  • Zod schema definition for input parameters (token and optional limit) of the get_user_playlists tool
    schema: createSchema({ token: commonSchemas.token(), limit: commonSchemas.limit(1, 50, 20), }),
  • Registration of all tools including playlistTools (containing get_user_playlists) into the central allTools registry used by ToolRegistrar
    export const allTools: ToolsRegistry = { ...albumTools, ...artistTools, ...trackTools, ...playlistTools, ...playbackTools, ...userTools, ...searchTools, };
  • SpotifyService helper method that makes the API request to Spotify's /me/playlists endpoint to fetch the user's playlists
    async getUserPlaylists( token: string, limit: number = 20 ): Promise<PagingObject<SpotifyPlaylist>> { return await this.makeRequest<PagingObject<SpotifyPlaylist>>( "me/playlists", token, { limit } ); }
  • ToolRegistrar constructor that initializes with allTools registry containing get_user_playlists and injects SpotifyService for handlers
    constructor(spotifyService: SpotifyService) { this.tools = allTools; this.spotifyService = spotifyService;

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