search_artists
Search for artists in the MusicBrainz database using filters like country, artist type, or gender to refine results beyond basic name searches.
Instructions
Search for artists with specific filters. Prefer search_entities for simple name searches; use this when filtering by country, type, or gender. Args: name: Artist name country: ISO 3166-1 alpha-2 country code artist_type: 'person', 'group', 'orchestra', 'choir', 'character', 'other' gender: 'male', 'female', 'other', 'not applicable' limit: Max results (default 5)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | ||
| country | No | ||
| artist_type | No | ||
| gender | No | ||
| limit | No |
Implementation Reference
- mcp_musicbrainz/server.py:252-286 (handler)The implementation of the search_artists tool, which takes search parameters and queries the MusicBrainz API, then formats the results into a string.
def search_artists( name: str, country: str | None = None, artist_type: str | None = None, gender: str | None = None, limit: int = 5, ) -> str: """ Search for artists with specific filters. Prefer search_entities for simple name searches; use this when filtering by country, type, or gender. Args: name: Artist name country: ISO 3166-1 alpha-2 country code artist_type: 'person', 'group', 'orchestra', 'choir', 'character', 'other' gender: 'male', 'female', 'other', 'not applicable' limit: Max results (default 5) """ kwargs = {"artist": name, "limit": limit} if country: kwargs["country"] = country if artist_type: kwargs["type"] = artist_type if gender: kwargs["gender"] = gender result = musicbrainzngs.search_artists(**kwargs) items = result.get("artist-list", []) lines = [f"Found {len(items)} artists:"] for i in items: aname = i.get("name") disambig = i.get("disambiguation", "") extra = f" ({disambig})" if disambig else "" lines.append(f"- {aname}{extra} | artist ID: {i['id']}") return "\n".join(lines)