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); }

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