search_tracks_by_filename
Locate tracks in the rekordbox DJ database by searching with a filename or partial filename. Returns a list of matching tracks for quick and precise results.
Instructions
Search for tracks by filename.
Args: filename: Filename to search for (partial match)
Returns: List of tracks matching the filename
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filename | Yes |
Implementation Reference
- rekordbox_mcp/server.py:230-246 (handler)MCP tool handler for search_tracks_by_filename. This is the main execution function decorated with @mcp.tool(), which also serves as registration. It delegates to the database helper.@mcp.tool() async def search_tracks_by_filename(filename: str) -> List[Dict[str, Any]]: """ Search for tracks by filename. Args: filename: Filename to search for (partial match) Returns: List of tracks matching the filename """ if not db: raise RuntimeError("Database not initialized.") tracks = await db.search_tracks_by_filename(filename) return [track.model_dump() for track in tracks]
- rekordbox_mcp/database.py:346-361 (helper)Database helper method that implements the core search logic by iterating over tracks and matching filename in the file path.async def search_tracks_by_filename(self, filename: str) -> List[Track]: """Search tracks by filename.""" 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] filename_lower = filename.lower() matching_tracks = [] for content in active_content: file_path = content.Location or "" if filename_lower in file_path.lower(): matching_tracks.append(self._content_to_track(content)) return matching_tracks
- rekordbox_mcp/server.py:230-230 (registration)The @mcp.tool() decorator registers this function as an MCP tool.@mcp.tool()