get_tracks_by_key
Find tracks in a specific musical key from your rekordbox DJ database. Use this tool to retrieve tracks matching a key like '5A' or '12B' for music organization and set planning.
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 primary handler function for the 'get_tracks_by_key' MCP tool, decorated with @mcp.tool() for automatic registration in the FastMCP server. It validates the database connection, constructs SearchOptions with the key filter (limit 1000), queries the RekordboxDatabase for matching tracks, and returns a list of serialized track 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]