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
| Name | Required | Description | Default |
|---|---|---|---|
| token | Yes | Spotify access token for authentication | |
| limit | No | ||
| offset | No |
Implementation Reference
- src/mcp/tools/tracks.ts:150-153 (handler)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); },
- src/mcp/tools/tracks.ts:145-149 (schema)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(), }),
- src/spotify.ts:428-440 (helper)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); }
- src/mcp/tools/index.ts:27-27 (registration)Registration of trackTools (including get_liked_tracks) into the allTools registry used by ToolRegistrar....trackTools,
- src/mcp/server.ts:14-14 (registration)Instantiation of ToolRegistrar which loads all tools including get_liked_tracks for MCP server.const toolRegistrar = new ToolRegistrar(spotifyService);