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
      );
    }
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 (track listing, durations, preview URLs, etc.), authentication needs (Spotify access token), and constraints (market availability). However, it doesn't mention rate limits, pagination behavior, or error handling, leaving some gaps for a read operation.

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

Conciseness4/5

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

The description is well-structured with clear sections (USE CASES, WHAT IT RETURNS, etc.) and front-loaded with the core purpose. While slightly verbose due to multiple examples and tips, each section adds value without redundancy. It could be more concise by trimming some repetitive examples, but overall it's efficiently organized.

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 tool's moderate complexity (3 parameters, no output schema, no annotations), the description is largely complete. It covers purpose, usage, returns, examples, tips, and requirements. However, without an output schema, it could benefit from more detail on the return structure (e.g., JSON format), and it lacks information on error cases or rate limits, leaving minor gaps.

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 67% (2 out of 3 parameters have descriptions). The description doesn't explicitly discuss parameters, but the 'EXAMPLES' section implies usage of albumId (e.g., 'album ID: 4LH4d3cOWNNsVw41Gqt2kv') and the 'REQUIREMENTS' section mentions the token. However, it doesn't clarify the limit parameter's role or provide additional semantics beyond what the schema offers, resulting in a baseline score.

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 clearly states the tool's purpose with specific verbs ('retrieve', 'get') and resource ('album tracks'), distinguishing it from siblings like get_album (which likely returns album metadata) and get_track (which returns individual track details). It explicitly mentions 'complete track listing' and 'detailed information about each song', making the scope unambiguous.

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 through dedicated sections: 'USE CASES' lists specific scenarios (e.g., building playlists, checking track order), 'TIPS' advises when to use it (e.g., before adding albums to playlists), and 'REQUIREMENTS' states prerequisites (valid token, market availability). This clearly informs the agent about appropriate contexts and constraints.

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