Skip to main content
Glama

playlist_sort

Sort a Spotify playlist in place by added date, name, artist, or duration. Use dry_run to preview the exact reordering before applying it.

Instructions

Sort a playlist in place by added_at/name/artist/duration. Quota: GET all + PUT/POST. popularity is not a sort key: the API no longer returns it on playlist items.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dry_runNoPreview only: validate inputs and describe exactly what would change without performing it
sort_byNoSort key applied to the playlistname_asc
max_resultsNoMax items to return (default: SPOTIFY_MCP_MAX_ITEMS env or 50)
playlist_idYesPlaylist ID, spotify:playlist: URI, or URL
response_formatNo'concise' = human prose, 'detailed' = more fields in prose, 'json' = raw API objectconcise

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv2.1.2
    • changedInput schema / properties / sort_by / enum
      Previous value: -[
      -  "added_asc",
      -  "added_desc",
      -  "name_asc",
      -  "name_desc",
      -  "artist_asc",
      -  "duration_asc",
      -  "duration_desc",
      -  "popularity_desc"
      -]New value: +[
      +  "added_asc",
      +  "added_desc",
      +  "name_asc",
      +  "name_desc",
      +  "artist_asc",
      +  "duration_asc",
      +  "duration_desc"
      +]
  2. Changed4 schema fields changedv1.31.0
    • removedInput schema / $schema
      Removed value: -"http://json-schema.org/draft-07/schema#"
    • addedInput schema / additionalProperties
      Added value: +false
    • addedInput schema / properties / playlist_id / description
      Added value: +"Playlist ID, spotify:playlist: URI, or URL"
    • addedInput schema / properties / sort_by / description
      Added value: +"Sort key applied to the playlist"
  3. Addedv1.26.1

TDQS

A3.8/5.0
Behavior4/5

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

Annotations only declare destructiveHint=false, so the description usefully adds that sorting happens in place (persistent mutation of the playlist), that it costs GET all + PUT/POST requests, and that 'popularity' is not a valid key because the API no longer returns it — a real guard against a plausible wrong invocation.

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?

Two tight sentences: the operation and keys come first, followed by cost and the popularity caveat. Every clause carries information an agent can act on, with no filler.

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?

No output schema exists, but the critical behavioral facts for a mutating playlist tool (in-place edit, quota cost, invalid key) are present. Minor gaps remain: it never mentions the dry_run preview path or that sorting can invalidate existing snapshots.

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 all five parameters (including dry_run and response_format) are already documented. The description only reinforces the sort key families and rules out popularity, which adds marginal value over the enum and defaults in the schema.

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 ('sort') and resource ('playlist') plus the in-place scope and the available key families (added_at/name/artist/duration). It does not differentiate itself from close siblings such as playlist_reverse, playlist_shuffle or reorder_playlist_items, so it lands at a clear-but-not-discriminating 4.

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

Usage Guidelines3/5

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

Usage is only implied by the key list; there is no statement of when to prefer this over playlist_reverse/playlist_shuffle/reorder_playlist_items, nor whether it requires an unfollowed/owned playlist or snapshot handling. The quota note hints at cost but is not a when-to-use rule.

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

Deploy Server

Other Tools