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;
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden and does well by disclosing key behavioral traits: it returns complete lists with specific data fields, includes owned and followed playlists, and has requirements like a valid Spotify token with playlist-read-private scope. It doesn't mention rate limits or pagination details, but covers authentication and scope needs thoroughly.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness2/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is overly verbose with sections like 'MANAGEMENT TIPS' and 'PLAYLIST ORGANIZATION' that don't add essential tool usage information. While front-loaded with core purpose, it includes redundant or tangential content that reduces efficiency, though not misleading.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations and no output schema, the description provides substantial context: it details what the tool returns, use cases, examples, and requirements. This compensates well for the lack of structured data, though it could benefit from mentioning error handling or response format specifics.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 50% (only 'token' has a description). The description adds no explicit parameter information beyond implying retrieval of playlists, which doesn't compensate for the undocumented 'limit' parameter. However, with two parameters and partial coverage, the baseline is met without significant added value.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'retrieve' and resource 'all playlists that the user owns, follows, or has access to in their Spotify library.' It distinguishes from siblings like 'get_playlist' (specific playlist) and 'search_playlists' (search across Spotify), making the scope explicit.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The 'USE CASES' section provides clear contexts for when to use this tool, such as displaying collections or building management interfaces. However, it lacks explicit guidance on when NOT to use it or direct alternatives among siblings, though the purpose clarity implies differentiation.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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