Skip to main content
Glama

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

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

Implementation Reference

  • MCP tool registration for 'get_album_tracks', defining metadata, input schema, and handler that delegates to SpotifyService.getAlbumTracks
    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); }, },
  • Handler function for the get_album_tracks tool, which validates args and calls the Spotify service method
    handler: async (args: any, spotifyService: SpotifyService) => { const { token, albumId, limit = 50 } = args; return await spotifyService.getAlbumTracks(token, albumId, limit); },
  • Input schema definition for get_album_tracks tool using common schemas for token, albumId, and optional limit
    schema: createSchema({ token: commonSchemas.token(), albumId: commonSchemas.spotifyId("album"), limit: commonSchemas.limit(1, 50, 50), }),
  • SpotifyService helper method implementing the core logic to fetch album tracks from Spotify API endpoint /albums/{id}/tracks
    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 ); }

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