get_album_tracks
Retrieve a detailed tracklist for any Spotify album, including song details, durations, artist credits, and availability. Use to build playlists, analyze album structure, or check track information before purchasing.
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 |
|---|---|---|---|
| albumId | Yes | Spotify album ID or URI | |
| limit | No | ||
| token | Yes | Spotify access token for authentication |
Implementation Reference
- src/spotify.ts:337-349 (handler)Core handler function in SpotifyService that makes the API call to retrieve the tracks of a Spotify album.async 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 ); }
- src/mcp/tools/albums.ts:120-123 (handler)MCP tool handler that destructures input arguments and delegates to the SpotifyService implementation.handler: 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 validation using createSchema from common schemas for token, albumId, and optional limit.schema: createSchema({ token: commonSchemas.token(), albumId: commonSchemas.spotifyId("album"), limit: commonSchemas.limit(1, 50, 50), }),
- src/mcp/tools/index.ts:22-36 (registration)Central tools registry where albumTools (containing get_album_tracks) is spread into allTools for MCP tool registration.export const allTools: ToolsRegistry = { ...albumTools, ...artistTools, ...trackTools, ...playlistTools, ...playbackTools, ...userTools, ...searchTools, };
- src/mcp/tools/albums.ts:83-124 (registration)Tool definition object for get_album_tracks exported as part of albumTools.get_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); }, },