Skip to main content
Glama

playlist_trim

Trim a Spotify playlist to N items by keeping the first, last, or random tracks; overwrites the playlist, deletes excluded rows, and asks confirmation.

Instructions

Trim playlist to N items (keep first/last/random) by OVERWRITING the playlist: every row outside the kept set is DELETED, and the kept rows are re-written in the new order. An overwrite that deletes rows asks for confirmation first. Quota: 2 walks of the playlist items + 2 metadata GETs + PUT/POST.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
keepYesHow many items to keep
dry_runNoPreview only: validate inputs and describe exactly what would change without performing it
keep_whichNoWhich end of the playlist to keep items from. Default firstfirst
playlist_idYesPlaylist ID, spotify:playlist: URI, or URL

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 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 / keep / description
      Added value: +"How many items to keep"
    • addedInput schema / properties / keep_which / description
      Added value: +"Which end of the playlist to keep items from. Default first"
    • addedInput schema / properties / playlist_id / description
      Added value: +"Playlist ID, spotify:playlist: URI, or URL"
  2. Addedv1.26.1

TDQS

B3.3/5.0
Behavior1/5

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

The description explicitly says rows outside the kept set are 'DELETED' and the playlist is overwritten, but the annotation declares destructiveHint=false, which in MCP means additive-only updates. A row-deleting overwrite is not additive, so the description directly contradicts the annotation. The added confirmation and quota context would otherwise be valuable.

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, front-loaded with the core action before the confirmation and quota details; each sentence carries distinct information. The all-caps emphasis is stylistically heavy but not padding.

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 destructive mutation with no output schema, the description covers the mutation mechanism, the confirmation gate, and the API quota cost, which is enough for an agent to call it correctly. Its only real deficiency is the conflict with the provided annotation.

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 keep, keep_which, dry_run, and playlist_id are already documented in the schema. The description restates the keep modes (first/last/random) but adds no syntax or format detail beyond what the schema provides, so the baseline of 3 applies.

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?

States a specific verb and resource ('trim playlist to N items') and names the three retention modes (first/last/random), letting an agent separate it from siblings like playlist_sort, split_playlist, and remove_from_playlist. The mechanism (overwrite + delete outside set) is spelled out up front.

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?

The behavior implies when this tool is relevant (cutting a playlist down to a fixed size), and dry_run's purpose is clarified, but there is no explicit 'use this instead of X' routing against the many neighboring playlist-mutation tools. Usage is inferred rather than stated.

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