Skip to main content
Glama

get_liked_tracks

Retrieve your saved Spotify tracks to display favorite music, create playlists, analyze preferences, or export your library. Returns track details, save dates, and artist/album info.

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
limitNo
offsetNo
tokenYesSpotify access token for authentication

Implementation Reference

  • Core handler implementation in SpotifyService that fetches the user's liked tracks from the Spotify API endpoint /me/tracks with pagination support.
    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); }
  • Tool registration defining the MCP tool 'get_liked_tracks' including title, description, schema, and handler that delegates to SpotifyService.
    get_liked_tracks: { title: "Get Liked Tracks", description: `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`, schema: createSchema({ token: commonSchemas.token(), limit: commonSchemas.limit(1, 50, 20), offset: commonSchemas.offset(), }), 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: token, optional limit (default 20), optional offset.
    schema: createSchema({ token: commonSchemas.token(), limit: commonSchemas.limit(1, 50, 20), offset: commonSchemas.offset(), }),
  • Aggregates trackTools (including get_liked_tracks) into allTools registry used by ToolRegistrar.
    ...trackTools,
  • Handler delegation to SpotifyService.getLikedTracks.
    return await spotifyService.getLikedTracks(token, limit, offset);

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