Skip to main content
Glama

get_artist_albums

Retrieve an artist's complete discography including albums, singles, compilations, and featured appearances to explore their musical catalog and release history.

Instructions

Explore an artist's complete discography including albums, singles, compilations, and appearances.

🎯 USE CASES: • Building complete artist discography playlists • Discovering rare releases and B-sides • Tracking artist evolution through their album releases • Finding collaborations and featured appearances • Creating chronological listening experiences

📝 WHAT IT RETURNS: • Complete album listing with release dates and types • Album artwork and track counts • Collaboration information and featured artists • Market availability and release formats • Popularity metrics for each release

🔍 EXAMPLES: • "Get all albums by The Beatles" • "Show me Drake's singles and EPs only" • "Find all releases by artist ID: 4dpARuHxo51G3z768sgnrY" • "I want to see Beyoncé's complete discography"

💡 ALBUM TYPES: • 'album' - Full studio albums • 'single' - Singles and EPs • 'compilation' - Greatest hits, compilations • 'appears_on' - Featured appearances on other artists' work

⚠️ REQUIREMENTS: • Valid Spotify access token • Artist must have releases available

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tokenYesSpotify access token for authentication
artistIdYesSpotify artist ID or URI
albumTypeNoalbum
limitNo

Implementation Reference

  • Core handler logic for fetching an artist's albums, singles, compilations, or appearances from the Spotify API.
    async getArtistAlbums( token: string, artistId: string, albumType: "album" | "single" | "appears_on" | "compilation" = "album", limit: number = 20 ): Promise<PagingObject<SpotifyAlbum>> { const id = this.extractId(artistId); const params = { include_groups: albumType, limit: Math.min(limit, 50), }; return await this.makeRequest<PagingObject<SpotifyAlbum>>( `artists/${id}/albums`, token, params ); }
  • Input schema validation for the get_artist_albums tool parameters: token, artistId, albumType, and limit.
    schema: createSchema({ token: commonSchemas.token(), artistId: commonSchemas.spotifyId("artist"), albumType: commonSchemas.albumType(), limit: commonSchemas.limit(1, 50, 20), }),
  • Tool definition and registration in artistTools export, including title, description, schema, and handler.
    get_artist_albums: { title: "Get Artist Albums", description: `Explore an artist's complete discography including albums, singles, compilations, and appearances. 🎯 USE CASES: • Building complete artist discography playlists • Discovering rare releases and B-sides • Tracking artist evolution through their album releases • Finding collaborations and featured appearances • Creating chronological listening experiences 📝 WHAT IT RETURNS: • Complete album listing with release dates and types • Album artwork and track counts • Collaboration information and featured artists • Market availability and release formats • Popularity metrics for each release 🔍 EXAMPLES: • "Get all albums by The Beatles" • "Show me Drake's singles and EPs only" • "Find all releases by artist ID: 4dpARuHxo51G3z768sgnrY" • "I want to see Beyoncé's complete discography" 💡 ALBUM TYPES: • 'album' - Full studio albums • 'single' - Singles and EPs • 'compilation' - Greatest hits, compilations • 'appears_on' - Featured appearances on other artists' work ⚠️ REQUIREMENTS: • Valid Spotify access token • Artist must have releases available`, schema: createSchema({ token: commonSchemas.token(), artistId: commonSchemas.spotifyId("artist"), albumType: commonSchemas.albumType(), limit: commonSchemas.limit(1, 50, 20), }), handler: async (args: any, spotifyService: SpotifyService) => { const { token, artistId, albumType = "album", limit = 20 } = args; return await spotifyService.getArtistAlbums( token, artistId, albumType, limit ); }, },
  • Aggregates artistTools (containing get_artist_albums) into the central allTools registry used by MCP ToolRegistrar.
    export const allTools: ToolsRegistry = { ...albumTools, ...artistTools, ...trackTools, ...playlistTools, ...playbackTools, ...userTools, ...searchTools, };
  • Instantiates SpotifyService and ToolRegistrar in the main MCP server, enabling tool discovery and execution.
    const spotifyService = new SpotifyService(); const toolRegistrar = new ToolRegistrar(spotifyService);

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