get_tracks_by_key
Retrieve tracks filtered by a specific musical key from the rekordbox DJ database. Input the key (e.g., "5A", "12B") to receive a list of matching tracks for DJing or music organization.
Instructions
Get all tracks in a specific musical key.
Args: key: Musical key (e.g., "5A", "12B")
Returns: List of tracks in the specified key
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| key | Yes |
Implementation Reference
- rekordbox_mcp/server.py:112-128 (handler)The handler function for the get_tracks_by_key tool. It is registered via the @mcp.tool() decorator. The function checks if the database is initialized, creates a SearchOptions object with the provided key and a limit of 1000, searches the database for matching tracks, and returns them as a list of dictionaries.@mcp.tool() async def get_tracks_by_key(key: str) -> List[Dict[str, Any]]: """ Get all tracks in a specific musical key. Args: key: Musical key (e.g., "5A", "12B") Returns: List of tracks in the specified key """ if not db: raise RuntimeError("Database not initialized.") search_options = SearchOptions(key=key, limit=1000) tracks = await db.search_tracks(search_options) return [track.model_dump() for track in tracks]
- rekordbox_mcp/server.py:112-112 (registration)The @mcp.tool() decorator registers the get_tracks_by_key function as an MCP tool.@mcp.tool()