Skip to main content
Glama

get_playlist

Retrieve comprehensive Spotify playlist information including tracks, metadata, creator details, and content analysis for discovery, curation, and planning purposes.

Instructions

Retrieve comprehensive information about any Spotify playlist including tracks, metadata, and creator details.

🎯 USE CASES: • Analyze playlist contents before following or copying • Check playlist length and total duration for events • View track listing to discover new music • Research playlist themes and genre consistency • Export playlist information for backup or sharing

📝 WHAT IT RETURNS: • Complete playlist metadata (name, description, creator) • Full track listing with artist and album information • Playlist artwork, follower count, and popularity metrics • Track order, durations, and explicit content flags • Public/private status and collaborative settings

🔍 EXAMPLES: • "Get details for Today's Top Hits playlist" • "Show me the tracks in playlist ID: 37i9dQZF1DXcBWIGoYBM5M" • "What songs are in my workout playlist?" • "Analyze this collaborative playlist my friends made"

💡 PLAYLIST INSIGHTS: • Perfect for playlist curation and discovery • Check before adding to your library • Great for party planning and event music selection • Useful for understanding music trends and preferences

⚠️ REQUIREMENTS: • Valid Spotify access token • Playlist must be public or user must have access

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tokenYesSpotify access token for authentication
playlistIdYesSpotify playlist ID or URI

Implementation Reference

  • MCP tool definition for 'get_playlist' including handler, schema, title, and description. The handler delegates to SpotifyService.getPlaylist.
      get_playlist: {
        title: "Get Playlist",
        description: `Retrieve comprehensive information about any Spotify playlist including tracks, metadata, and creator details.
    
    🎯 USE CASES:
    • Analyze playlist contents before following or copying
    • Check playlist length and total duration for events
    • View track listing to discover new music
    • Research playlist themes and genre consistency
    • Export playlist information for backup or sharing
    
    📝 WHAT IT RETURNS:
    • Complete playlist metadata (name, description, creator)
    • Full track listing with artist and album information
    • Playlist artwork, follower count, and popularity metrics
    • Track order, durations, and explicit content flags
    • Public/private status and collaborative settings
    
    🔍 EXAMPLES:
    • "Get details for Today's Top Hits playlist"
    • "Show me the tracks in playlist ID: 37i9dQZF1DXcBWIGoYBM5M"
    • "What songs are in my workout playlist?"
    • "Analyze this collaborative playlist my friends made"
    
    💡 PLAYLIST INSIGHTS:
    • Perfect for playlist curation and discovery
    • Check before adding to your library
    • Great for party planning and event music selection
    • Useful for understanding music trends and preferences
    
    ⚠️ REQUIREMENTS:
    • Valid Spotify access token
    • Playlist must be public or user must have access`,
        schema: createSchema({
          token: commonSchemas.token(),
          playlistId: commonSchemas.spotifyId("playlist"),
        }),
        handler: async (args: any, spotifyService: SpotifyService) => {
          const { token, playlistId } = args;
          return await spotifyService.getPlaylist(token, playlistId);
        },
      },
  • Input schema validation for get_playlist tool using Zod: requires token and playlistId.
    schema: createSchema({
      token: commonSchemas.token(),
      playlistId: commonSchemas.spotifyId("playlist"),
    }),
  • Registration of playlistTools (including get_playlist) into the central allTools registry used by ToolRegistrar for MCP tool definitions and handlers.
    export const allTools: ToolsRegistry = {
      ...albumTools,
    
      ...artistTools,
    
      ...trackTools,
    
      ...playlistTools,
    
      ...playbackTools,
    
      ...userTools,
    
      ...searchTools,
    };
  • SpotifyService.getPlaylist method: extracts ID and makes API request to fetch playlist details from Spotify API.
    async getPlaylist(
      token: string,
      playlistId: string
    ): Promise<SpotifyPlaylist> {
      const id = this.extractId(playlistId);
      return await this.makeRequest<SpotifyPlaylist>(`playlists/${id}`, token);
    }
Behavior4/5

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

With no annotations provided, the description carries full burden and does well: it discloses authentication needs (Spotify access token), access constraints (public or user-accessible playlists), and return content (metadata, tracks, metrics). It doesn't mention rate limits or pagination, but covers key behavioral aspects for a read operation.

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

Conciseness3/5

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

The description is well-structured with clear sections (USE CASES, WHAT IT RETURNS, etc.), but it's verbose with redundant information. Some content (e.g., 'Perfect for playlist curation') is promotional rather than essential. It could be more concise while maintaining clarity.

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 compensates well by detailing return values, use cases, and requirements. It covers authentication, access, and output content thoroughly. However, it lacks explicit error handling or pagination details, leaving minor gaps for a comprehensive retrieval tool.

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 100%, so parameters are fully documented in the schema. The description adds no specific parameter semantics beyond what's in the schema (e.g., no format examples for playlistId). It mentions requirements that relate to parameters but doesn't enhance their meaning, meeting the baseline for high schema coverage.

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 tool retrieves comprehensive playlist information including tracks, metadata, and creator details. It specifies the exact resource (Spotify playlist) and distinguishes from siblings like get_playlist_tracks (which might only return tracks) and get_user_playlists (which lists playlists rather than details of one).

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

Usage Guidelines5/5

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

The description provides explicit usage guidance with dedicated sections: 'USE CASES' lists specific scenarios, 'PLAYLIST INSIGHTS' suggests optimal contexts, and 'REQUIREMENTS' states prerequisites. It implicitly distinguishes from alternatives by focusing on comprehensive retrieval rather than partial data or actions like create_playlist.

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