Skip to main content
Glama

playlist_union

Merge 2–10 Spotify playlists into one target playlist, removing duplicate tracks while preserving first-seen order. Preview changes with dry_run before creating or replacing the target.

Instructions

Union of 2–10 playlists into target (deduped, first-seen order). An empty union empties the target the same way subtract does. Quota: N GETs + PUT/POST; replacing an existing target also reads its current items and its playlist metadata to measure the destructive impact.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoSource page size, 1–100. Default: 100
dedupeNoDrop duplicate URIs across the merged sources. Default true
dry_runNoPreview only: validate inputs and describe exactly what would change without performing it
scan_capNoMaximum source rows to scan; bounded by SPOTIFY_MCP_FETCH_ALL_CAP
playlistsNoCanonical ordered playlists (2–10)
max_resultsNoMax items to return (default: SPOTIFY_MCP_MAX_ITEMS env or 50)
target_nameNoName for a newly created target playlist; provide exactly one of target_playlist_id or target_name
response_formatNo'concise' = human prose, 'detailed' = more fields in prose, 'json' = raw API objectconcise
target_playlist_idNoExisting target playlist (ID, URI, or URL); provide exactly one of target_playlist_id or target_name

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv3.0.1
    • changedInput schema / properties / playlists / description
      Previous value: -"Canonical ordered playlists (2–10), or provide the complete documented legacy alias accepted by this tool"New value: +"Canonical ordered playlists (2–10)"
    • removedInput schema / properties / source_playlist_ids
      Removed value: -{
      -  "description": "Deprecated one-release alias supported through v2.0; removed in v2.1. Provide this complete alias or canonical playlists.",
      -  "items": {
      -    "description": "Playlist ID, spotify:playlist: URI, or Spotify playlist URL; use this reference in the canonical or documented legacy field",
      -    "minLength": 1,
      -    "type": "string"
      -  },
      -  "maxItems": 10,
      -  "minItems": 2,
      -  "type": "array"
      -}
  2. Changed15 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 / dedupe / description
      Added value: +"Drop duplicate URIs across the merged sources. Default true"
    • addedInput schema / properties / limit
      Added value: +{
      +  "description": "Source page size, 1–100. Default: 100",
      +  "maximum": 100,
      +  "minimum": 1,
      +  "type": "integer"
      +}
    • addedInput schema / properties / max_results
      Added value: +{
      +  "description": "Max items to return (default: SPOTIFY_MCP_MAX_ITEMS env or 50)",
      +  "exclusiveMinimum": 0,
      +  "maximum": 2000,
      +  "type": "integer"
      +}
    • addedInput schema / properties / playlists
      Added value: +{
      +  "description": "Canonical ordered playlists (2–10), or provide the complete documented legacy alias accepted by this tool",
      +  "items": {
      +    "description": "Playlist ID, spotify:playlist: URI, or Spotify playlist URL; use this reference in the canonical or documented legacy field",
      +    "minLength": 1,
      +    "type": "string"
      +  },
      +  "maxItems": 10,
      +  "minItems": 2,
      +  "type": "array"
      +}
    • addedInput schema / properties / response_format
      Added value: +{
      +  "default": "concise",
      +  "description": "'concise' = human prose, 'detailed' = more fields in prose, 'json' = raw API object",
      +  "enum": [
      +    "concise",
      +    "detailed",
      +    "json"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / scan_cap
      Added value: +{
      +  "description": "Maximum source rows to scan; bounded by SPOTIFY_MCP_FETCH_ALL_CAP",
      +  "maximum": 10000,
      +  "minimum": 1,
      +  "type": "integer"
      +}
    • addedInput schema / properties / source_playlist_ids / description
      Added value: +"Deprecated one-release alias supported through v2.0; removed in v2.1. Provide this complete alias or canonical playlists."
    • addedInput schema / properties / source_playlist_ids / items / description
      Added value: +"Playlist ID, spotify:playlist: URI, or Spotify playlist URL; use this reference in the canonical or documented legacy field"
    • addedInput schema / properties / source_playlist_ids / items / minLength
      Added value: +1
    • addedInput schema / properties / target_name / description
      Added value: +"Name for a newly created target playlist; provide exactly one of target_playlist_id or target_name"
    • addedInput schema / properties / target_playlist_id / description
      Added value: +"Existing target playlist (ID, URI, or URL); provide exactly one of target_playlist_id or target_name"
    • addedInput schema / properties / target_playlist_id / minLength
      Added value: +1
    • removedInput schema / required
      Removed value: -[
      -  "source_playlist_ids"
      -]
  3. Addedv1.26.1

TDQS

B3.1/5.0
Behavior1/5

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

The description states that an empty union 'empties the target' and that replacing an existing target reads its items 'to measure the destructive impact' — the tool's own words acknowledge data destruction, while the annotation declares destructiveHint=false. This is a direct conflict between the description and the structured safety signal, which is worse than silence for an agent deciding whether to call it unattended.

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?

Three dense sentences, front-loaded with the core operation, then the empty-union edge case, then cost. Nothing is repetitive, though 'N GETs + PUT/POST' and the trailing clause about reading playlist metadata are terse to the point of being cryptic.

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?

For a 9-parameter mutation with full schema coverage and no output schema, the description covers the essential operational facts: merge semantics, ordering, the empty-input trap, and request cost. It omits auth/prerequisite and failure behavior, but nothing needed to invoke it correctly is missing.

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 every parameter (limit, dedupe, dry_run, scan_cap, max_results, response_format, target_*) is already explained in the schema. The description adds ordering/dedupe semantics and a rough quota model but no per-parameter meaning beyond that, so the baseline 3 applies.

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 opening clause gives a specific verb+resource and precise semantics ('Union of 2–10 playlists into target (deduped, first-seen order)'), which cleanly separates it from shuffle/trim-ish siblings. It never names the nearest alternatives (merge_playlists, playlist_symmetric_difference, playlist_subtract) outright, so an agent must infer the routing itself.

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: the analogy 'the same way subtract does' and the quota note hint at when this set-operation is appropriate, and dry_run is available in the schema. There is no explicit when-to-use statement, no when-not-to-use, and no named alternative such as merge_playlists, so the agent gets context but no routing 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