Skip to main content
Glama
superseoworld

MCP Spotify Server

get_artist_albums

Retrieve an artist's albums from Spotify's catalog using their ID, with options to filter by album type and control result pagination.

Instructions

Get Spotify catalog information about an artist's albums

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesThe Spotify ID or URI for the artist
include_groupsNoOptional. Filter by album types
limitNoMaximum number of albums to return (1-50)
offsetNoThe index of the first album to return

Implementation Reference

  • Core handler function that implements the get_artist_albums tool logic: extracts artist ID, validates limit/offset, builds query params, and calls Spotify API endpoint /artists/{id}/albums.
    async getArtistAlbums(args: ArtistAlbumsArgs) {
      const artistId = this.extractArtistId(args.id);
      const { limit = 20, offset = 0, include_groups } = args;
    
      if (limit < 1 || limit > 50) {
        throw new McpError(
          ErrorCode.InvalidParams,
          'Limit must be between 1 and 50'
        );
      }
    
      if (offset < 0) {
        throw new McpError(
          ErrorCode.InvalidParams,
          'Offset must be non-negative'
        );
      }
    
      const params = {
        limit,
        offset,
        include_groups: include_groups?.join(',')
      };
    
      return this.api.makeRequest(
        `/artists/${artistId}/albums${this.api.buildQueryString(params)}`
      );
    }
  • src/index.ts:203-237 (registration)
    Tool registration in listTools handler, defining name, description, and inputSchema for get_artist_albums.
    {
      name: 'get_artist_albums',
      description: 'Get Spotify catalog information about an artist\'s albums',
      inputSchema: {
        type: 'object',
        properties: {
          id: {
            type: 'string',
            description: 'The Spotify ID or URI for the artist'
          },
          include_groups: {
            type: 'array',
            items: {
              type: 'string',
              enum: ['album', 'single', 'appears_on', 'compilation']
            },
            description: 'Optional. Filter by album types'
          },
          limit: {
            type: 'number',
            description: 'Maximum number of albums to return (1-50)',
            minimum: 1,
            maximum: 50,
            default: 20
          },
          offset: {
            type: 'number',
            description: 'The index of the first album to return',
            minimum: 0,
            default: 0
          }
        },
        required: ['id']
      },
    },
  • src/index.ts:742-748 (registration)
    Dispatch case in callToolRequestSchema handler that routes get_artist_albums calls to ArtistsHandler.getArtistAlbums.
    case 'get_artist_albums': {
      const args = this.validateArgs<ArtistAlbumsArgs>(request.params.arguments, ['id']);
      const result = await this.artistsHandler.getArtistAlbums(args);
      return {
        content: [{ type: 'text', text: JSON.stringify(result, null, 2) }],
      };
    }
  • TypeScript interface defining the input arguments for get_artist_albums, used for type validation and matching the MCP inputSchema.
    export interface ArtistAlbumsArgs extends ArtistArgs, PaginationParams {
      include_groups?: ('album' | 'single' | 'appears_on' | 'compilation')[];
    }
Behavior2/5

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

With no annotations provided, the description carries full burden but offers minimal behavioral insight. It mentions 'catalog information' which implies read-only data retrieval, but doesn't disclose rate limits, authentication requirements, pagination behavior (beyond schema hints), or what specific album details are returned. For a tool with 4 parameters and no annotation coverage, this is inadequate.

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

Conciseness5/5

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

The description is a single, efficient sentence that communicates the core purpose without waste. It's appropriately front-loaded with the main action and resource, making it easy to parse quickly.

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

Completeness2/5

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

For a tool with 4 parameters, no annotations, and no output schema, the description is insufficient. It doesn't explain what information is returned about albums (titles, release dates, track counts), authentication needs, rate limits, or error conditions. The schema handles parameters well, but overall context for agent usage is lacking.

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

Parameters3/5

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

Schema description coverage is 100%, so the schema fully documents all parameters. The description adds no additional parameter semantics beyond what's in the schema (e.g., it doesn't clarify 'include_groups' usage or 'id' format examples). Baseline 3 is appropriate when schema does all the work.

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

Purpose4/5

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

The description clearly states the action ('Get Spotify catalog information') and resource ('about an artist's albums'), making the purpose immediately understandable. It doesn't explicitly differentiate from sibling tools like 'get_artist' or 'get_album', but the focus on albums is specific enough for basic understanding.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention sibling tools like 'get_artist' (for general artist info) or 'search' (for broader album discovery), nor does it specify use cases like retrieving discography versus filtering by album type.

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/superseoworld/mcp-spotify'

If you have feedback or need assistance with the MCP directory API, please join our Discord server