Skip to main content
Glama

sort_playlist_apply

Reorder a Spotify playlist in place by name, artist, album, duration, added-at date, or release era. Preview the plan with dry-run mode, then commit the change with an atomic replace after backing up the original items.

Instructions

Sort a playlist in place by name, artist, album, duration, added-at date or release era: backs up the current items to a local file first, then rewrites via one atomic replace. dry_run=true (default) previews only. Quota: 🟢 GET + 1 local write + 1 PUT.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dry_runNoPreview only: perform the read side and return a PLAN without changing anything. Pass false to commit. Default true
sort_byNoSort key. Default name
directionNoSort direction. Default asc
max_resultsNoMax items to return (default: SPOTIFY_MCP_MAX_ITEMS env or 50)
playlist_idYesPlaylist to sort (ID or spotify:playlist: URI)
response_formatNo'concise' = human prose, 'detailed' = more fields in prose, 'json' = raw API objectconcise
Behavior5/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 discharges it excellently: it discloses that this is a mutating operation, that a local backup is created first, that the rewrite is a single atomic replace, that dry-run previews without changing anything, and even the quota cost (1 GET + 1 local write + 1 PUT). This is exactly the behavioral context an agent needs to safely invoke a mutation tool.

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?

Three dense sentences, zero filler: purpose and safety behavior first, then mode semantics, then quota cost. The most decision-relevant information (it's an in-place mutation with a safety backup) is front-loaded before operational details.

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 mutation tool with no annotations and no output schema, the description covers the essential contract: what changes, how it protects against data loss (backup + atomic replace), how to preview safely, and the cost. It leaves return-value details to the schema's PLAN mention and doesn't clarify edge behavior around max_results, but nothing critical to calling it safely 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 the baseline is 3. The description's sort-key list maps onto the sort_by enum and 'release era' helpfully aligns with the release_date value, but the schema already documents all parameters thoroughly; the dry_run restatement adds minimal value beyond the schema's own detailed description.

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 precise action ('Sort a playlist in place') with an explicit list of sort keys (name, artist, album, duration, added-at date, release era). The 'in place' scoping plus the backup-then-atomic-replace detail clearly distinguishes it from plan-only siblings like sort_playlist_plan and simpler utilities like playlist_sort.

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 gives clear internal mode guidance ('dry_run=true (default) previews only'), implying a preview-then-commit workflow. However, it never explicitly routes the agent between this tool and the closely related sort_playlist_plan sibling, nor states when committing is appropriate versus when a plan-only tool should be used.

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