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