Skip to main content
Glama
davehenke

rekordbox-mcp

get_unplayed_tracks

Identify tracks in your rekordbox DJ database that have never been played to discover fresh music for your sets.

Instructions

Get tracks that have never been played.

Args: limit: Maximum number of tracks to return

Returns: List of unplayed tracks

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNo

Implementation Reference

  • MCP tool registration and handler function for get_unplayed_tracks. Ensures database connection, calls the database helper method, and converts Track models to dictionaries for the MCP response.
    @mcp.tool()
    async def get_unplayed_tracks(limit: int = 50) -> List[Dict[str, Any]]:
        """
        Get tracks that have never been played.
        
        Args:
            limit: Maximum number of tracks to return
            
        Returns:
            List of unplayed tracks
        """
        if not db:
            raise RuntimeError("Database not initialized.")
        
        tracks = await db.get_unplayed_tracks(limit)
        return [track.model_dump() for track in tracks]
  • Database class method implementing the core logic: loads all content, filters active tracks with DJPlayCount == 0, converts to Track models, and limits results.
    async def get_unplayed_tracks(self, limit: int = 50) -> List[Track]:
        """Get tracks that have never been played."""
        if not self.db:
            raise RuntimeError("Database not connected")
        
        all_content = list(self.db.get_content())
        active_content = [c for c in all_content if getattr(c, 'rb_local_deleted', 0) == 0]
        # Filter tracks with 0 play count
        unplayed = [content for content in active_content if (getattr(content, 'DJPlayCount', 0) or 0) == 0]
        
        return [self._content_to_track(content) for content in unplayed[:limit]]

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