search_releases
Find music releases by filtering with artist name, label, barcode, or title to locate specific albums or recordings in the MusicBrainz database.
Instructions
Search for releases with specific filters. Prefer search_entities for simple title searches; use this when filtering by artist, label, or barcode. Args: title: Release title artist: Artist name label: Label name barcode: UPC/EAN barcode limit: Max results (default 5)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| title | No | ||
| artist | No | ||
| label | No | ||
| barcode | No | ||
| limit | No |
Implementation Reference
- mcp_musicbrainz/server.py:291-331 (handler)The search_releases function performs the logic of querying the MusicBrainz API and formatting the release results.
def search_releases( title: str | None = None, artist: str | None = None, label: str | None = None, barcode: str | None = None, limit: int = 5, ) -> str: """ Search for releases with specific filters. Prefer search_entities for simple title searches; use this when filtering by artist, label, or barcode. Args: title: Release title artist: Artist name label: Label name barcode: UPC/EAN barcode limit: Max results (default 5) """ kwargs = {"limit": limit} if title: kwargs["release"] = title if artist: kwargs["artist"] = artist if label: kwargs["label"] = label if barcode: kwargs["barcode"] = barcode if not any((title, artist, label, barcode)): return "Please provide at least one search parameter." result = musicbrainzngs.search_releases(**kwargs) items = result.get("release-list", []) lines = [f"Found {len(items)} releases:"] for i in items: rtitle = i.get("title") rartist = i.get("artist-credit-phrase", "Unknown") date = i.get("date", "?") lines.append(f"- {rtitle} by {rartist} ({date}) | release ID: {i['id']}") return "\n".join(lines) - mcp_musicbrainz/server.py:289-290 (registration)The search_releases function is registered as an MCP tool using the @mcp.tool() decorator.
@mcp.tool() @cached_tool()