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);
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively describes what the tool returns (e.g., 'Complete album listing with release dates and types,' 'Popularity metrics'), authentication needs ('Valid Spotify access token'), and constraints ('Artist must have releases available'). However, it lacks details on rate limits, pagination (implied by 'limit' parameter but not explained), or error handling.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with sections (USE CASES, WHAT IT RETURNS, etc.), but it is verbose with repetitive examples and details that could be condensed. Some sentences, like the examples, add value but could be more concise. Overall, it's informative but not optimally tight.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity (4 parameters, no annotations, no output schema), the description is mostly complete. It covers purpose, usage, returns, examples, and requirements. However, without an output schema, it should ideally detail the response structure more explicitly, though the 'WHAT IT RETURNS' section provides a good overview.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 50% (two parameters have descriptions, two do not). The description compensates by explaining 'albumType' in the 'ALBUM TYPES' section, clarifying the enum values beyond the schema. It also implies usage of 'artistId' through examples. However, it doesn't add meaning for 'token' or 'limit' beyond what the schema provides.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description explicitly states the tool's purpose: 'Explore an artist's complete discography including albums, singles, compilations, and appearances.' It uses specific verbs ('explore') and resources ('artist's discography'), and clearly distinguishes from sibling tools like 'get_artist' (which likely gets basic artist info) and 'get_album' (which focuses on a single album).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit guidance on when to use this tool through the 'USE CASES' section (e.g., 'Building complete artist discography playlists,' 'Discovering rare releases'), and the 'REQUIREMENTS' section specifies prerequisites ('Valid Spotify access token,' 'Artist must have releases available'). It also distinguishes from alternatives by focusing on discography exploration rather than single albums or tracks.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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