Skip to main content
Glama

clean_all_playlists

Destructive

Scan all Spotify playlists for duplicate tracks by URI or name/artist, report findings, and optionally remove duplicates with a confirmation before deletion.

Instructions

Scan every playlist in your library for duplicate items (repeated URIs, and on opt-in same-song copies under different URIs when match_by=name_artist). Reports per-playlist findings by default; pass apply=true to remove them (keeps the first occurrence of each group). Bulk removals ask for one confirmation before anything is deleted. See the duplicate-matching vocabulary in SPEC section 4.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
applyNoDeprecated alias for dry_run — prefer dry_run. false (default): report only. true: execute the cleanup across all playlists with duplicates. If both are given, dry_run wins.
dry_runNoPreview only — when true, nothing is changed; when false via dry_run=false or apply=true, executes the cleanup
match_byNoWhich rule decides that two items are the same: `uri` (exact URI, the default), `name_artist` (case-insensitive name + credited artists, catches relinks/remasters), or `name` (case-insensitive name only). The rule applied is echoed in the result as `match_by`.
max_resultsNoMax items to return (default: SPOTIFY_MCP_MAX_ITEMS env or 50)
response_formatNo'concise' = human prose, 'detailed' = more fields in prose, 'json' = raw API objectconcise
include_relinkedNoDeprecated alias for `match_by`, kept for one release: true is `name_artist` and false is `uri`. It cannot express the `name` rule, which is why `match_by` replaced it. Sending both, where they mean different rules, is an error rather than a silent choice.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv3.0.1
    • removedInput schema / properties / include_relinked / default
      Removed value: -false
    • changedInput schema / properties / include_relinked / description
      Previous value: -"Also count/collapse same-song entries under different URIs (relinks/remasters)."New value: +"Deprecated alias for `match_by`, kept for one release: true is `name_artist` and false is `uri`. It cannot express the `name` rule, which is why `match_by` replaced it. Sending both, where they mean different rules, is an error rather than a silent choice."
    • addedInput schema / properties / match_by
      Added value: +{
      +  "description": "Which rule decides that two items are the same: `uri` (exact URI, the default), `name_artist` (case-insensitive name + credited artists, catches relinks/remasters), or `name` (case-insensitive name only). The rule applied is echoed in the result as `match_by`.",
      +  "enum": [
      +    "uri",
      +    "name_artist",
      +    "name"
      +  ],
      +  "type": "string"
      +}
  2. Changed2 schema fields changedv1.31.0
    • removedInput schema / $schema
      Removed value: -"http://json-schema.org/draft-07/schema#"
    • addedInput schema / additionalProperties
      Added value: +false
  3. Changed2 schema fields changedv1.28.0
    • changedInput schema / properties / apply / description
      Previous value: -"false (default): report only — nothing is changed. true: execute the cleanup across all playlists with duplicates."New value: +"Deprecated alias for dry_run — prefer dry_run. false (default): report only. true: execute the cleanup across all playlists with duplicates. If both are given, dry_run wins."
    • addedInput schema / properties / dry_run
      Added value: +{
      +  "description": "Preview only — when true, nothing is changed; when false via dry_run=false or apply=true, executes the cleanup",
      +  "type": "boolean"
      +}
  4. Addedv1.26.1

TDQS

A4.1/5.0
Behavior4/5

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

Annotations only declare destructiveHint=true, so the description usefully adds that the default is non-destructive, that the first occurrence of each duplicate group is preserved, and that bulk deletions require one confirmation. It could say more about irreversibility or whether an undo/receipt applies, but the safety-relevant behavior is well covered.

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 tight sentences that front-load scope and default behavior before the mutation switch. The closing pointer to 'SPEC section 4' is an external dependency that costs a little self-containedness.

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?

With no output schema, the description does state what comes back (per-playlist findings, match_by echoed in results) and covers the confirmation flow for destructive runs. Complete enough for a library-wide cleanup tool, though return shape detail is thin.

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 each parameter is already documented in the schema. The description reinforces match_by semantics and the deprecation of apply, but adds no syntax or format detail the schema lacks. Baseline 3 is appropriate.

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?

Specific verb (scan/clean) plus resource (every playlist in your library) plus the object of interest (duplicate items), with the default behavior spelled out. It is clearly differentiated from single-playlist siblings like find_duplicates_in_playlist and remove_duplicate_playlist_items by the library-wide scope.

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?

States the default mode (report only) and the switch to mutation (apply=true), plus the confirmation gate for bulk removal. It does not explicitly name the single-playlist alternatives or say when a user should prefer them, so it falls short of a full when/when-not/alternative routing.

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