Skip to main content
Glama
davehenke

rekordbox-mcp

create_playlist

Create a new playlist in rekordbox DJ software by specifying a name and optional parent folder, directly modifying your rekordbox database.

Instructions

Create a new playlist in rekordbox.

⚠️ CAUTION: This modifies your rekordbox database!

Args: name: Name for the new playlist parent_id: Optional parent folder ID (omit for root level)

Returns: Information about the created playlist

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes
parent_idNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • MCP tool handler for 'create_playlist'. Decorated with @mcp.tool() which registers it as an MCP tool. Validates input, ensures DB connection, calls database helper, and returns formatted response.
    @mcp.tool(
        annotations={
            "readOnlyHint": False,
            "destructiveHint": False,
            "idempotentHint": False
        }
    )
    async def create_playlist(
        name: str,
        parent_id: Optional[str] = None
    ) -> Dict[str, Any]:
        """
        Create a new playlist in rekordbox.
        
        ⚠️ CAUTION: This modifies your rekordbox database!
        
        Args:
            name: Name for the new playlist
            parent_id: Optional parent folder ID (omit for root level)
            
        Returns:
            Information about the created playlist
        """
        await ensure_database_connected()
        
        if not name.strip():
            raise ValueError("Playlist name cannot be empty")
        
        try:
            playlist_id = await db.create_playlist(name.strip(), parent_id)
            return {
                "status": "success",
                "message": f"Created playlist '{name}'",
                "playlist_id": playlist_id,
                "playlist_name": name
            }
        except Exception as e:
            return {
                "status": "error", 
                "message": f"Failed to create playlist: {str(e)}"
            }
  • Database helper method implementing playlist creation using pyrekordbox library. Creates backup, calls pyrekordbox.create_playlist, commits, handles return value, with error rollback.
    async def create_playlist(self, name: str, parent_id: Optional[str] = None) -> str:
        """
        Create a new playlist.
        
        Args:
            name: Name for the new playlist
            parent_id: Optional parent folder ID
            
        Returns:
            ID of the created playlist
        """
        if not self.db:
            raise RuntimeError("Database not connected")
        
        try:
            # Create backup before mutation
            await self._create_backup()
            
            # Create playlist using pyrekordbox
            playlist = self.db.create_playlist(
                name=name,
                parent=parent_id if parent_id and parent_id != "root" else None
            )
            
            # Debug: check what type playlist is
            logger.debug(f"playlist type: {type(playlist)}")
            logger.debug(f"playlist value: {playlist}")
            
            # Commit changes
            self.db.commit()
            
            # Handle different return types
            if hasattr(playlist, 'ID'):
                playlist_id = str(playlist.ID)
            elif isinstance(playlist, str):
                playlist_id = playlist
            else:
                # Try to get ID from the playlist object
                playlist_id = str(playlist)
            
            logger.info(f"Created playlist '{name}' with ID {playlist_id}")
            return playlist_id
            
        except Exception as e:
            logger.error(f"Failed to create playlist '{name}': {e}")
            # Rollback on error
            if hasattr(self.db, 'rollback'):
                self.db.rollback()
            raise RuntimeError(f"Failed to create playlist: {str(e)}")
Behavior4/5

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

The description adds valuable behavioral context beyond annotations by including a caution note ('⚠️ CAUTION: This modifies your rekordbox database!'), which highlights the mutation aspect and potential impact. Annotations already indicate it's not read-only, not idempotent, and not destructive, so the description complements this by emphasizing the database modification, though it doesn't detail rate limits or auth needs.

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 appropriately sized and front-loaded with the purpose and caution, followed by structured sections for args and returns. Every sentence earns its place, with no redundant information, making it efficient and easy to parse.

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 (mutation with 2 parameters), no schema descriptions, and the presence of an output schema (which handles return values), the description is mostly complete. It covers purpose, caution, parameters, and return info, but could improve by mentioning sibling tools or specific usage scenarios.

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 both parameters: 'name' as 'Name for the new playlist' and 'parent_id' as 'Optional parent folder ID (omit for root level)'. This adds clear meaning beyond the schema, though it doesn't specify format details like ID structure or name constraints.

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 ('Create a new playlist') and resource ('in rekordbox'), distinguishing it from sibling tools like 'delete_playlist' or 'get_playlists'. It explicitly identifies what the tool does without being vague or tautological.

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 caution note about database modification, suggesting it's for write operations, but does not explicitly state when to use this tool versus alternatives like 'get_playlists' for reading or 'delete_playlist' for removal. No specific exclusions or prerequisites are mentioned.

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