Skip to main content
Glama

get_top_rated_tracks

Retrieve a list of the highest-rated tracks from your rekordbox library, customizable by limit for efficient track selection and management.

Instructions

Get the highest rated tracks in the library.

Args: limit: Maximum number of tracks to return

Returns: List of top rated tracks

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNo

Implementation Reference

  • MCP tool handler for 'get_top_rated_tracks', registered via @mcp.tool() decorator. Fetches top rated tracks from database and serializes to dicts for MCP response.
    @mcp.tool() async def get_top_rated_tracks(limit: int = 20) -> List[Dict[str, Any]]: """ Get the highest rated tracks in the library. Args: limit: Maximum number of tracks to return Returns: List of top rated tracks """ if not db: raise RuntimeError("Database not initialized.") tracks = await db.get_top_rated_tracks(limit) return [track.model_dump() for track in tracks]
  • Database class helper method implementing the core logic: retrieves all active tracks, sorts by rating (desc) then DJPlayCount (desc), limits to N, converts to Track models.
    async def get_top_rated_tracks(self, limit: int = 20) -> List[Track]: """Get the highest rated tracks.""" 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] # Sort by rating descending, then by play count sorted_content = sorted(active_content, key=lambda x: (getattr(x, 'Rating', 0) or 0, getattr(x, 'DJPlayCount', 0) or 0), reverse=True) return [self._content_to_track(content) for content in sorted_content[: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