get_album_tracks
Retrieve complete track listings for Spotify albums to view song details, durations, and artist credits for playlist creation or analysis.
Instructions
Retrieve the complete track listing for any album, including detailed information about each song.
π― USE CASES: β’ Building custom playlists from favorite albums β’ Checking track order and durations before purchase β’ Creating "deep cuts" playlists from lesser-known album tracks β’ Analyzing album structure and flow β’ Finding specific tracks within concept albums or compilations
π WHAT IT RETURNS: β’ Complete ordered track listing with track numbers β’ Individual track durations and preview URLs β’ Track popularity scores and explicit content flags β’ Artist credits for each track (including featured artists) β’ External IDs and market availability per track
π EXAMPLES: β’ "Get all tracks from 'Dark Side of the Moon' album" β’ "Show me the tracklist for album ID: 4LH4d3cOWNNsVw41Gqt2kv" β’ "I want to see all songs from this compilation album" β’ "List the tracks from this soundtrack, limit to 20"
π‘ TIPS: β’ Use this before adding entire albums to playlists β’ Great for discovering hidden gems in large albums β’ Check explicit flags if building family-friendly playlists
β οΈ REQUIREMENTS: β’ Valid Spotify access token β’ Album must be available in user's market
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| token | Yes | Spotify access token for authentication | |
| albumId | Yes | Spotify album ID or URI | |
| limit | No |
Implementation Reference
- src/mcp/tools/albums.ts:83-124 (registration)MCP tool registration for 'get_album_tracks', defining metadata, input schema, and handler that delegates to SpotifyService.getAlbumTracksget_album_tracks: { title: "Get Album Tracks", description: `Retrieve the complete track listing for any album, including detailed information about each song. π― USE CASES: β’ Building custom playlists from favorite albums β’ Checking track order and durations before purchase β’ Creating "deep cuts" playlists from lesser-known album tracks β’ Analyzing album structure and flow β’ Finding specific tracks within concept albums or compilations π WHAT IT RETURNS: β’ Complete ordered track listing with track numbers β’ Individual track durations and preview URLs β’ Track popularity scores and explicit content flags β’ Artist credits for each track (including featured artists) β’ External IDs and market availability per track π EXAMPLES: β’ "Get all tracks from 'Dark Side of the Moon' album" β’ "Show me the tracklist for album ID: 4LH4d3cOWNNsVw41Gqt2kv" β’ "I want to see all songs from this compilation album" β’ "List the tracks from this soundtrack, limit to 20" π‘ TIPS: β’ Use this before adding entire albums to playlists β’ Great for discovering hidden gems in large albums β’ Check explicit flags if building family-friendly playlists β οΈ REQUIREMENTS: β’ Valid Spotify access token β’ Album must be available in user's market`, schema: createSchema({ token: commonSchemas.token(), albumId: commonSchemas.spotifyId("album"), limit: commonSchemas.limit(1, 50, 50), }), handler: async (args: any, spotifyService: SpotifyService) => { const { token, albumId, limit = 50 } = args; return await spotifyService.getAlbumTracks(token, albumId, limit); }, },
- src/mcp/tools/albums.ts:120-123 (handler)Handler function for the get_album_tracks tool, which validates args and calls the Spotify service methodhandler: async (args: any, spotifyService: SpotifyService) => { const { token, albumId, limit = 50 } = args; return await spotifyService.getAlbumTracks(token, albumId, limit); },
- src/mcp/tools/albums.ts:115-119 (schema)Input schema definition for get_album_tracks tool using common schemas for token, albumId, and optional limitschema: createSchema({ token: commonSchemas.token(), albumId: commonSchemas.spotifyId("album"), limit: commonSchemas.limit(1, 50, 50), }),
- src/spotify.ts:337-349 (helper)SpotifyService helper method implementing the core logic to fetch album tracks from Spotify API endpoint /albums/{id}/tracksasync getAlbumTracks( token: string, albumId: string, limit: number = 50 ): Promise<PagingObject<SpotifyTrack>> { const id = this.extractId(albumId); const params = { limit: Math.min(limit, 50) }; return await this.makeRequest<PagingObject<SpotifyTrack>>( `albums/${id}/tracks`, token, params ); }