Skip to main content
Glama
davehenke

rekordbox-mcp

get_tracks_by_bpm_range

Filter and retrieve tracks from a rekordbox database based on a specified beats-per-minute range to match tempo requirements for DJ sets or music organization.

Instructions

Get tracks within a specific BPM range.

Args: bpm_min: Minimum BPM bpm_max: Maximum BPM

Returns: List of tracks within the BPM range

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
bpm_minYes
bpm_maxYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The primary handler for the 'get_tracks_by_bpm_range' tool. Decorated with @mcp.tool() for automatic registration in FastMCP. Implements the core logic by creating SearchOptions and delegating to the database search.
    @mcp.tool()
    async def get_tracks_by_bpm_range(bpm_min: float, bpm_max: float) -> List[Dict[str, Any]]:
        """
        Get tracks within a specific BPM range.
        
        Args:
            bpm_min: Minimum BPM
            bpm_max: Maximum BPM
            
        Returns:
            List of tracks within the BPM range
        """
        if not db:
            raise RuntimeError("Database not initialized.")
        
        search_options = SearchOptions(bpm_min=bpm_min, bpm_max=bpm_max, limit=1000)
        tracks = await db.search_tracks(search_options)
        return [track.model_dump() for track in tracks]
  • Pydantic model defining SearchOptions used in the tool handler for input validation and filtering criteria, including bpm_min and bpm_max with range validation.
    class SearchOptions(BaseModel):
        """
        Search criteria for track queries.
        """
        
        query: str = Field("", description="General search query")
        artist: Optional[str] = Field(None, description="Filter by artist name")
        title: Optional[str] = Field(None, description="Filter by track title")
        album: Optional[str] = Field(None, description="Filter by album name")
        genre: Optional[str] = Field(None, description="Filter by genre")
        key: Optional[str] = Field(None, description="Filter by musical key")
        bpm_min: Optional[float] = Field(None, ge=0, description="Minimum BPM")
        bpm_max: Optional[float] = Field(None, ge=0, description="Maximum BPM")
        rating_min: Optional[int] = Field(None, ge=0, le=5, description="Minimum rating")
        rating_max: Optional[int] = Field(None, ge=0, le=5, description="Maximum rating")
        play_count_min: Optional[int] = Field(None, ge=0, description="Minimum play count")
        play_count_max: Optional[int] = Field(None, ge=0, description="Maximum play count")
        limit: int = Field(50, ge=1, le=1000, description="Maximum number of results")
        
        @field_validator('bpm_max')
        @classmethod
        def validate_bpm_range(cls, v, info):
            """Ensure bpm_max is greater than bpm_min."""
            if v and info.data.get('bpm_min') and v < info.data['bpm_min']:
                raise ValueError('bpm_max must be greater than bpm_min')
            return v
        
        @field_validator('rating_max')
        @classmethod
        def validate_rating_range(cls, v, info):
            """Ensure rating_max is greater than rating_min."""
            if v and info.data.get('rating_min') and v < info.data['rating_min']:
                raise ValueError('rating_max must be greater than rating_min')
            return v
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It states the tool retrieves tracks but doesn't disclose behavioral traits such as whether it's read-only, requires authentication, has rate limits, returns paginated results, or handles edge cases like invalid BPM values. The description is minimal and lacks critical operational context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized and front-loaded: the first sentence states the purpose, followed by structured 'Args' and 'Returns' sections. There's no wasted text, but the structure could be more integrated (e.g., merging the first sentence with the sections) for better flow.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's low complexity (2 parameters) and the presence of an output schema (implied by 'Returns: List of tracks'), the description is somewhat complete but lacks depth. It covers basic purpose and parameters but misses behavioral details and usage guidelines, which are important for a tool with no annotations and multiple siblings.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. It adds meaning by explaining that 'bpm_min' is the 'Minimum BPM' and 'bpm_max' is the 'Maximum BPM', clarifying the parameters' roles in defining a range. However, it doesn't specify units, valid ranges, or whether values are inclusive/exclusive, leaving some ambiguity.

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 tool's purpose: 'Get tracks within a specific BPM range.' It specifies the verb ('Get') and resource ('tracks'), and the BPM range adds specificity. However, it doesn't explicitly differentiate from sibling tools like 'get_tracks_by_key' or 'search_tracks', which could also filter tracks by different criteria.

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 sibling tools like 'get_tracks_by_key' or 'search_tracks', nor does it specify prerequisites, exclusions, or optimal contexts for BPM-based filtering. Usage is implied but not articulated.

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