Skip to main content
Glama
davehenke

rekordbox-mcp

remove_track_from_playlist

Idempotent

Delete a specific track from a rekordbox playlist by providing playlist and track IDs. This action directly modifies your rekordbox database.

Instructions

Remove a track from a playlist.

⚠️ CAUTION: This modifies your rekordbox database!

Args: playlist_id: ID of the playlist to modify track_id: ID of the track to remove

Returns: Result of the operation

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
playlist_idYes
track_idYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • MCP tool handler that removes a track from a playlist by calling the database method and returning success/error status.
    async def remove_track_from_playlist(
        playlist_id: str,
        track_id: str
    ) -> Dict[str, Any]:
        """
        Remove a track from a playlist.
        
        ⚠️ CAUTION: This modifies your rekordbox database!
        
        Args:
            playlist_id: ID of the playlist to modify
            track_id: ID of the track to remove
            
        Returns:
            Result of the operation
        """
        await ensure_database_connected()
        
        try:
            success = await db.remove_track_from_playlist(playlist_id, track_id)
            if success:
                return {
                    "status": "success",
                    "message": f"Removed track {track_id} from playlist {playlist_id}",
                    "playlist_id": playlist_id,
                    "track_id": track_id
                }
            else:
                return {
                    "status": "error",
                    "message": "Failed to remove track from playlist"
                }
        except Exception as e:
            return {
                "status": "error",
                "message": f"Failed to remove track from playlist: {str(e)}"
            }
  • FastMCP tool registration decorator for remove_track_from_playlist with safety annotations.
    @mcp.tool(
        annotations={
            "readOnlyHint": False,
            "destructiveHint": False,
            "idempotentHint": True
        }
    )
  • Database layer helper method that executes the track removal using pyrekordbox API, including backup and transaction handling.
    async def remove_track_from_playlist(self, playlist_id: str, track_id: str) -> bool:
        """
        Remove a track from a playlist.
        
        Args:
            playlist_id: ID of the playlist
            track_id: ID of the track to remove
            
        Returns:
            True if successful
        """
        if not self.db:
            raise RuntimeError("Database not connected")
        
        try:
            # Create backup before mutation
            await self._create_backup()
            
            # Remove track from playlist using pyrekordbox
            playlist_int_id = int(playlist_id)
            track_int_id = int(track_id)
            
            self.db.remove_from_playlist(playlist_int_id, track_int_id)
            
            # Commit changes
            self.db.commit()
            
            logger.info(f"Removed track {track_id} from playlist {playlist_id}")
            return True
            
        except Exception as e:
            logger.error(f"Failed to remove track {track_id} from playlist {playlist_id}: {e}")
            # Rollback on error
            if hasattr(self.db, 'rollback'):
                self.db.rollback()
            raise RuntimeError(f"Failed to remove track from 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: the '⚠️ CAUTION: This modifies your rekordbox database!' warning emphasizes the mutation impact, which annotations only partially cover (readOnlyHint=false, destructiveHint=false). It also mentions the return value ('Result of the operation'), though output schema exists. However, it doesn't detail idempotency (implied by annotation) or specific error behaviors, leaving some gaps.

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 well-structured and front-loaded: the core purpose is stated first, followed by a caution note, then parameter and return sections. Every sentence earns its place—no redundancy or fluff. The bullet-point format for Args/Returns enhances readability without wasting space.

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 database impact), annotations cover safety aspects (readOnlyHint=false, idempotentHint=true, destructiveHint=false), and an output schema exists, the description is reasonably complete. It adds crucial behavioral warnings and parameter context. However, it lacks explicit usage prerequisites or error handling details, slightly reducing completeness for a mutation tool.

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 0%, but the description compensates by listing both parameters (playlist_id, track_id) with brief explanations ('ID of the playlist to modify', 'ID of the track to remove'). This adds meaning beyond the bare schema, clarifying what each ID represents. However, it doesn't provide format details, validation rules, or examples, keeping it at baseline adequacy.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Remove a track from a playlist') with specific verb and resource, making the purpose immediately understandable. It distinguishes from siblings like 'add_track_to_playlist' by specifying removal rather than addition. However, it doesn't explicitly differentiate from 'delete_playlist' (which removes entire playlists) or other playlist-modifying tools, keeping it from a perfect score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing valid playlist and track IDs), compare with similar tools like 'delete_playlist' for entire playlist removal, or specify error conditions. The caution note about database modification is behavioral, not usage guidance.

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