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
| Name | Required | Description | Default |
|---|---|---|---|
| keep | Yes | How many items to keep | |
| dry_run | No | Preview only: validate inputs and describe exactly what would change without performing it | |
| keep_which | No | Which end of the playlist to keep items from. Default first | first |
| playlist_id | Yes | Playlist ID, spotify:playlist: URI, or URL |