Skip to main content
Glama
jamiew

Spotify MCP Server

by jamiew

Get Playlist Tracks

get_playlist_tracks
Read-onlyIdempotent

Retrieve tracks from a Spotify playlist with pagination controls for limit and offset. Fetch a specific range or all tracks up to a safety limit.

Instructions

Get tracks from a playlist with full pagination support.

Args:
    playlist_id: Playlist ID
    limit: Max tracks to return (None for all tracks, up to 10,000 safety limit)
    offset: Number of tracks to skip for pagination (default 0)

Returns:
    PlaylistTracks with 'items' (list of tracks), 'total', 'limit', 'offset'

Note: Large playlists require pagination. Use limit/offset to get specific ranges:
- Get first 100: limit=100, offset=0
- Get next 100: limit=100, offset=100
- Get all tracks: limit=None (use with caution on very large playlists)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNo
offsetNo
playlist_idYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
itemsYes
limitNo
totalYes
offsetYes
returnedYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed6 schema fields changedv0.6.1
    • addedOutput schema / $defs / Track / properties / id / anyOf
      Added value: +[
      +  {
      +    "type": "string"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • addedOutput schema / $defs / Track / properties / id / default
      Added value: +null
    • removedOutput schema / $defs / Track / properties / id / type
      Removed value: -"string"
    • addedOutput schema / $defs / Track / properties / is_local
      Added value: +{
      +  "default": false,
      +  "title": "Is Local",
      +  "type": "boolean"
      +}
    • addedOutput schema / $defs / Track / properties / played_at
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Played At"
      +}
    • changedOutput schema / $defs / Track / required
      Previous value: -[
      -  "name",
      -  "id",
      -  "artist"
      -]New value: +[
      +  "name",
      +  "artist"
      +]
  2. Changed5 schema fields changedv0.3.1
    • addedOutput schema / $defs
      Added value: +{
      +  "Track": {
      +    "description": "A Spotify track with metadata.",
      +    "properties": {
      +      "added_at": {
      +        "anyOf": [
      +          {
      +            "type": "string"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "title": "Added At"
      +      },
      +      "album": {
      +        "anyOf": [
      +          {
      +            "type": "string"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "title": "Album"
      +      },
      +      "album_id": {
      +        "anyOf": [
      +          {
      +            "type": "string"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "title": "Album Id"
      +      },
      +      "artist": {
      +        "title": "Artist",
      +        "type": "string"
      +      },
      +      "artists": {
      +        "anyOf": [
      +          {
      +            "items": {
      +              "type": "string"
      +            },
      +            "type": "array"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "title": "Artists"
      +      },
      +      "duration_ms": {
      +        "anyOf": [
      +          {
      +            "type": "integer"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "title": "Duration Ms"
      +      },
      +      "external_urls": {
      +        "anyOf": [
      +          {
      +            "additionalProperties": {
      +              "type": "string"
      +            },
      +            "type": "object"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "title": "External Urls"
      +      },
      +      "id": {
      +        "title": "Id",
      +        "type": "string"
      +      },
      +      "name": {
      +        "title": "Name",
      +        "type": "string"
      +      },
      +      "popularity": {
      +        "anyOf": [
      +          {
      +            "type": "integer"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "title": "Popularity"
      +      },
      +      "release_date": {
      +        "anyOf": [
      +          {
      +            "type": "string"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "title": "Release Date"
      +      }
      +    },
      +    "required": [
      +      "name",
      +      "id",
      +      "artist"
      +    ],
      +    "title": "Track",
      +    "type": "object"
      +  }
      +}
    • addedOutput schema / description
      Added value: +"Paginated tracks from a single playlist."
    • addedOutput schema / properties
      Added value: +{
      +  "items": {
      +    "items": {
      +      "$ref": "#/$defs/Track"
      +    },
      +    "title": "Items",
      +    "type": "array"
      +  },
      +  "limit": {
      +    "anyOf": [
      +      {
      +        "type": "integer"
      +      },
      +      {
      +        "type": "null"
      +      }
      +    ],
      +    "default": null,
      +    "title": "Limit"
      +  },
      +  "offset": {
      +    "title": "Offset",
      +    "type": "integer"
      +  },
      +  "returned": {
      +    "title": "Returned",
      +    "type": "integer"
      +  },
      +  "total": {
      +    "title": "Total",
      +    "type": "integer"
      +  }
      +}
    • addedOutput schema / required
      Added value: +[
      +  "items",
      +  "total",
      +  "offset",
      +  "returned"
      +]
    • changedOutput schema / title
      Previous value: -"get_playlist_tracksDictOutput"New value: +"PlaylistTracks"
  3. Addedv1.0.0

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already declare readOnlyHint/idempotentHint, so the safety profile is established. The description adds non-obvious behavioral details beyond those annotations: the 10,000-item safety cap, pagination skip semantics, and the caution warning for limit=None on large playlists. No contradiction with annotations.

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?

Purpose is front-loaded, followed by compact Args and Returns sections and a practical Note. The pagination examples are genuinely useful but somewhat repetitive (three near-identical illustrations); all content earns its place though a leaner version could drop one example.

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

Completeness5/5

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

Covers purpose, all three parameters, the return shape, pagination patterns, and a safety caveat. An output schema exists, so return values are doubly documented. For a read-only, paginated list tool this is essentially complete; only auth and rate-limit notes are absent, and those are not critical for correct invocation.

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

Parameters5/5

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

Schema description coverage is 0%, so the description carries full weight for parameter meaning. It explains limit's None semantics with the 10,000 safety ceiling, offset's skip behavior and default of 0, and playlist_id's role as the target resource — exactly the non-obvious semantics an agent needs that the bare schema types cannot convey.

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?

States a specific verb+resource ('Get tracks from a playlist with full pagination support') that clearly identifies the operation. The resource is unambiguous and implicitly distinct from siblings like get_playlist (playlist metadata) and get_tracks (tracks by ID), though it doesn't name them explicitly.

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

Usage Guidelines4/5

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

Provides concrete pagination usage patterns (limit=100/offset=0 for the first page, offset=100 for the next, limit=None for all tracks) and warns when caution is needed on very large playlists. It doesn't state exclusions or when to prefer a sibling tool, but the guidance is clear enough for correct invocation.

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