Skip to main content
Glama
davehenke

rekordbox-mcp

delete_playlist

DestructiveIdempotent

Permanently remove a playlist from rekordbox by specifying its ID. This action cannot be undone, so verify the playlist before proceeding.

Instructions

Delete a playlist from rekordbox.

⚠️ DANGER: This permanently deletes a playlist and cannot be undone!

Args: playlist_id: ID of the playlist to delete

Returns: Result of the operation

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
playlist_idYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Primary MCP tool handler decorated with @mcp.tool(). Performs safety checks (existence, smart playlist), calls database helper, formats response with status, message, and details.
    @mcp.tool(
        annotations={
            "readOnlyHint": False,
            "destructiveHint": True,
            "idempotentHint": True
        }
    )
    async def delete_playlist(playlist_id: str) -> Dict[str, Any]:
        """
        Delete a playlist from rekordbox.
        
        ⚠️ DANGER: This permanently deletes a playlist and cannot be undone!
        
        Args:
            playlist_id: ID of the playlist to delete
            
        Returns:
            Result of the operation
        """
        await ensure_database_connected()
        
        try:
            # Get playlist info before deletion for confirmation
            playlists = await db.get_playlists()
            target_playlist = next((p for p in playlists if p.id == playlist_id), None)
            
            if not target_playlist:
                return {
                    "status": "error",
                    "message": f"Playlist {playlist_id} not found"
                }
            
            # Prevent deletion of smart playlists for safety
            if target_playlist.is_smart_playlist:
                return {
                    "status": "error",
                    "message": "Cannot delete smart playlists - they are managed by rekordbox"
                }
            
            success = await db.delete_playlist(playlist_id)
            if success:
                return {
                    "status": "success",
                    "message": f"Deleted playlist '{target_playlist.name}' ({playlist_id})",
                    "deleted_playlist": {
                        "id": playlist_id,
                        "name": target_playlist.name,
                        "track_count": target_playlist.track_count
                    }
                }
            else:
                return {
                    "status": "error",
                    "message": "Failed to delete playlist"
                }
        except Exception as e:
            return {
                "status": "error",
                "message": f"Failed to delete playlist: {str(e)}"
            }
  • RekordboxDatabase class method implementing the core deletion logic: creates backup, converts ID to int, calls pyrekordbox db.delete_playlist(), commits or rolls back.
    async def delete_playlist(self, playlist_id: str) -> bool:
        """
        Delete a playlist.
        
        Args:
            playlist_id: ID of the playlist to delete
            
        Returns:
            True if successful
        """
        if not self.db:
            raise RuntimeError("Database not connected")
        
        try:
            # Create backup before mutation
            await self._create_backup()
            
            # Delete playlist using pyrekordbox
            playlist_int_id = int(playlist_id)
            self.db.delete_playlist(playlist_int_id)
            
            # Commit changes
            self.db.commit()
            
            logger.info(f"Deleted playlist {playlist_id}")
            return True
            
        except Exception as e:
            logger.error(f"Failed to delete playlist {playlist_id}: {e}")
            # Rollback on error
            if hasattr(self.db, 'rollback'):
                self.db.rollback()
            raise RuntimeError(f"Failed to delete playlist: {str(e)}")
  • @mcp.tool decorator registers the delete_playlist function as an MCP tool with destructive and idempotent hints.
    @mcp.tool(
        annotations={
            "readOnlyHint": False,
            "destructiveHint": True,
            "idempotentHint": True
        }
    )
Behavior4/5

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

Annotations already indicate destructiveHint=true and readOnlyHint=false, but the description adds critical context: 'permanently deletes' and 'cannot be undone', emphasizing irreversible consequences. It doesn't fully cover aspects like error handling or permissions, but provides valuable behavioral insight beyond annotations.

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?

The description is front-loaded with the core action and danger warning, followed by structured Args and Returns sections. Every sentence adds value: the warning highlights risk, and the parameter/return explanations are necessary for clarity without redundancy.

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?

Given the tool's complexity (destructive operation with 1 parameter) and annotations/output schema coverage, the description is mostly complete. It covers the irreversible nature and parameter purpose, though it could benefit from more on error cases or confirmation steps, but the output schema likely handles return values.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage, the description compensates by explaining the 'playlist_id' parameter as 'ID of the playlist to delete', adding meaning not in the schema. It doesn't detail format or constraints, but clarifies the parameter's role effectively.

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 clearly states the specific action ('Delete a playlist') and resource ('from rekordbox'), distinguishing it from sibling tools like 'create_playlist' or 'remove_track_from_playlist'. It explicitly identifies the tool's function without ambiguity.

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 implies usage through the danger warning about permanent deletion, suggesting it should be used cautiously. However, it lacks explicit guidance on when to use this tool versus alternatives (e.g., 'remove_track_from_playlist' for partial removal) or prerequisites like playlist existence.

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/davehenke/rekordbox-mcp'

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