Skip to main content
Glama
superseoworld

MCP Spotify Server

get_playlist_tracks

Retrieve detailed track information from any Spotify playlist by providing its ID, including optional filters for market, fields, and pagination.

Instructions

Get full details of the tracks of a playlist

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesThe Spotify ID or URI of the playlist
marketNoOptional. An ISO 3166-1 alpha-2 country code
fieldsNoOptional. Filters for the query
limitNoOptional. Maximum number of tracks to return (1-100)
offsetNoOptional. Index of the first track to return

Implementation Reference

  • Core handler function that implements the get_playlist_tracks tool logic by extracting the playlist ID, building query parameters, and calling the Spotify API endpoint /playlists/{id}/tracks.
    async getPlaylistTracks(args: PlaylistTracksArgs) {
      const playlistId = this.extractPlaylistId(args.id);
      const { market, limit, offset, fields } = args;
    
      const params = {
        market,
        ...(limit !== undefined && { limit }),
        ...(offset !== undefined && { offset }),
        ...(fields !== undefined && { fields })
      };
    
      return this.api.makeRequest(
        `/playlists/${playlistId}/tracks${this.api.buildQueryString(params)}`
      );
    }
  • src/index.ts:462-492 (registration)
    Tool registration in the MCP server's listTools response, defining the tool name, description, and input schema.
    name: 'get_playlist_tracks',
    description: 'Get full details of the tracks of a playlist',
    inputSchema: {
      type: 'object',
      properties: {
        id: {
          type: 'string',
          description: 'The Spotify ID or URI of the playlist'
        },
        market: {
          type: 'string',
          description: 'Optional. An ISO 3166-1 alpha-2 country code'
        },
        fields: {
          type: 'string',
          description: 'Optional. Filters for the query'
        },
        limit: {
          type: 'number',
          description: 'Optional. Maximum number of tracks to return (1-100)',
          minimum: 1,
          maximum: 100
        },
        offset: {
          type: 'number',
          description: 'Optional. Index of the first track to return',
          minimum: 0
        }
      },
      required: ['id']
    },
  • src/index.ts:837-843 (registration)
    Dispatch handler in the callTool request that validates arguments and delegates to the playlistsHandler.getPlaylistTracks method.
    case 'get_playlist_tracks': {
      const args = this.validateArgs<PlaylistTracksArgs>(request.params.arguments, ['id']);
      const result = await this.playlistsHandler.getPlaylistTracks(args);
      return {
        content: [{ type: 'text', text: JSON.stringify(result, null, 2) }],
      };
    }
  • TypeScript type definition for the input arguments of get_playlist_tracks, extending common market and pagination parameters.
    export interface PlaylistTracksArgs extends MarketParams, PaginationParams {
      id: string;
      fields?: string;
    }
  • Helper method used by getPlaylistTracks to normalize playlist ID from Spotify URI or plain ID.
    private extractPlaylistId(id: string): string {
      return id.startsWith('spotify:playlist:') ? id.split(':')[2] : id;
    }
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It states this is a read operation ('Get'), but doesn't mention authentication requirements, rate limits, pagination behavior (despite limit/offset parameters), or what 'full details' includes. This leaves significant gaps for a tool with 5 parameters.

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 unnecessary words. It's appropriately sized for a straightforward retrieval tool and front-loads the essential information.

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 5 parameters, no annotations, and no output schema, the description is insufficient. It doesn't explain what 'full details' includes, how results are structured, authentication requirements, or how to handle pagination. The description should provide more context given the complexity and lack of structured metadata.

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 5 parameters. The description adds no additional parameter information beyond what's in the schema. The baseline score of 3 reflects adequate but minimal value added by the description regarding parameters.

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 verb 'Get' and resource 'full details of the tracks of a playlist', making the purpose unambiguous. However, it doesn't distinguish this tool from its sibling 'get_playlist_items' which appears to serve a similar function, preventing a perfect score.

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 like 'get_playlist_items' or 'get_playlist'. There's no mention of prerequisites, constraints, or comparative use cases with sibling tools.

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