Skip to main content
Glama

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

TableJSON Schema
NameRequiredDescriptionDefault
albumIdYesSpotify album ID or URI
limitNo
tokenYesSpotify access token for authentication

Implementation Reference

  • 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 ); }
  • 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); },
  • 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), }),
  • 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, };
  • 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); }, },

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