Skip to main content
Glama

playlist_keep_only

Prune a playlist by keeping only items that match specified URIs, artist, type, or name query and removing all others in a single atomic replace.

Instructions

Inverse removal: keep only matching items (by uri / artist / type / query) and drop everything else — one atomic replace, no N+1 deletes. Quota: 🟢 GET + 1 PUT.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
typeNotype mode: keep only this playable type
queryNoquery mode: keep items whose name contains this substring
artistNoartist mode: keep tracks by this artist (ID/URI or name)
valuesNouris mode: track uris to keep
dry_runNoPreview only: perform the read side and return a PLAN without changing anything. Default true — pass false to commit.
keep_byYesMatch mode for what to KEEP
max_resultsNoMax items to return (default: SPOTIFY_MCP_MAX_ITEMS env or 50)
playlist_idYesPlaylist to prune (ID or spotify:playlist: URI)
response_formatNo'concise' = human prose, 'detailed' = more fields in prose, 'json' = raw API objectconcise
Behavior4/5

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

With no annotations provided, the description carries the full burden, and it delivers: it discloses the destructive consequence ('drop everything else'), the atomic single-replace implementation, and the quota cost ('GET + 1 PUT'). It does not discuss reversibility or permission needs, but the atomicity and cost disclosure go meaningfully beyond the schema.

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 sentences with zero filler: the first front-loads the core semantic and behavior, the second gives the quota. Every clause earns its place, and the high-value 'atomic replace, no N+1 deletes' detail is positioned right after the purpose statement.

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 tool with no annotations and no output schema, the description covers the essential behavior: semantics, match modes, atomicity, and cost. The main gaps are the lack of explicit guidance on pairing keep_by with the correct mode-specific parameter and no mention of return shape, though the schema's self-describing params and dry_run/response_format fields partially compensate.

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 the baseline is 3 and the schema already documents all 9 parameters. The description adds modest value by enumerating the four match modes (uri / artist / type / query), which maps onto the keep_by enum and its companion params, but it adds no syntax or format detail beyond that.

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?

The description opens with 'Inverse removal' and states a specific operation: 'keep only matching items (by uri / artist / type / query) and drop everything else.' This clearly names the verb, resource, and scope, and the inverse-removal framing distinguishes it from removal/trim siblings like remove_from_playlist and filter_playlist_by_artist.

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 description conveys when to use the tool via 'keep only matching items and drop everything else' and hints at efficiency advantages ('one atomic replace, no N+1 deletes'). However, it does not explicitly name any sibling alternative or state when NOT to use it, leaving the agent to infer routing against a sibling list that includes closely related tools like playlist_keep_artist, playlist_trim, and replace_playlist_items.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/NovaLux12/spotify-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server