Skip to main content
Glama

search_history_sessions

Filter and retrieve DJ history sessions by name, year, month, or track count to analyze and organize performance data efficiently.

Instructions

Search DJ history sessions with various filters.

Args: query: Search query for session names year: Filter by year (e.g., "2025") month: Filter by month (e.g., "08" for August) min_tracks: Minimum number of tracks in session limit: Maximum number of results

Returns: List of matching history sessions

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNo
min_tracksNo
monthNo
queryNo
yearNo

Implementation Reference

  • The main handler function for the 'search_history_sessions' tool. Decorated with @mcp.tool() for registration. It connects to the database, fetches all history sessions, applies client-specified filters (query, year, month, min_tracks), sorts by date descending, and limits results.
    @mcp.tool() async def search_history_sessions( query: str = "", year: Optional[str] = None, month: Optional[str] = None, min_tracks: Optional[int] = None, limit: int = 50 ) -> List[Dict[str, Any]]: """ Search DJ history sessions with various filters. Args: query: Search query for session names year: Filter by year (e.g., "2025") month: Filter by month (e.g., "08" for August) min_tracks: Minimum number of tracks in session limit: Maximum number of results Returns: List of matching history sessions """ await ensure_database_connected() sessions = await db.get_history_sessions(include_folders=False) # Apply filters filtered_sessions = [] for session in sessions: # Text search if query and query.lower() not in session.name.lower(): continue # Date filters if session.date_created: if year and not session.date_created.startswith(year): continue if month and year: month_str = f"{year}-{month.zfill(2)}" if not session.date_created.startswith(month_str): continue elif year or month: # Skip if date filters specified but no date available continue # Track count filter if min_tracks and session.track_count < min_tracks: continue filtered_sessions.append(session) # Sort by date, most recent first filtered_sessions.sort(key=lambda x: x.date_created or "", reverse=True) return [session.model_dump() for session in filtered_sessions[: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