Skip to main content
Glama

get_liked_tracks

Retrieve your saved Spotify tracks to access your music library, create playlists, analyze preferences, or export favorites with timestamps and details.

Instructions

Access the user's personal collection of liked/saved tracks from their Spotify library.

🎯 USE CASES: • Display user's favorite music collection in applications • Create personalized playlists from liked songs • Analyze personal music taste and preferences • Build recommendation systems based on user favorites • Export personal music library for backup or migration

📝 WHAT IT RETURNS: • Complete collection of user's liked/saved tracks • Track information with save dates and timestamps • Artist, album, and release information for each track • Chronological order of when tracks were liked • Total count of saved tracks in library

🔍 EXAMPLES: • "Show me my liked songs collection" • "Get my 50 most recently liked tracks" • "What songs have I saved to my library?" • "Export my favorite tracks with save dates"

💖 PERSONAL COLLECTION: • Reflects user's musical taste and preferences • Shows evolution of music taste over time • Perfect for building "greatest hits" playlists • Useful for music discovery based on preferences • Great for sharing favorite music with friends

💡 COLLECTION INSIGHTS: • Track when musical tastes changed or evolved • Identify patterns in saved music genres • Use for personalized recommendation systems • Perfect for "throwback" and nostalgia playlists • Analyze your music journey over time

⚠️ REQUIREMENTS: • Valid Spotify access token with user-library-read scope • User must have saved tracks in their library

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tokenYesSpotify access token for authentication
limitNo
offsetNo

Implementation Reference

  • The MCP tool handler function for 'get_liked_tracks' that extracts arguments and delegates to SpotifyService.getLikedTracks.
    handler: async (args: any, spotifyService: SpotifyService) => { const { token, limit = 20, offset = 0 } = args; return await spotifyService.getLikedTracks(token, limit, offset); },
  • Zod schema definition for input validation of the 'get_liked_tracks' tool parameters (token, limit, offset).
    schema: createSchema({ token: commonSchemas.token(), limit: commonSchemas.limit(1, 50, 20), offset: commonSchemas.offset(), }),
  • SpotifyService helper method that makes the API call to Spotify's /me/tracks endpoint to retrieve user's liked/saved tracks.
    async getLikedTracks( token: string, limit: number = 20, offset: number = 0 ): Promise<PagingObject<{ added_at: string; track: SpotifyTrack }>> { const params = { limit: Math.min(limit, 50), offset: offset, }; return await this.makeRequest< PagingObject<{ added_at: string; track: SpotifyTrack }> >("me/tracks", token, params); }
  • Registration of trackTools (including get_liked_tracks) into the allTools registry used by ToolRegistrar.
    ...trackTools,
  • Instantiation of ToolRegistrar which loads all tools including get_liked_tracks for MCP server.
    const toolRegistrar = new ToolRegistrar(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