Skip to main content
Glama
zas

MusicBrainz MCP Server

by zas

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
NameRequiredDescriptionDefault
nameYes
countryNo
artist_typeNo
genderNo
limitNo

Implementation Reference

  • 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)

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/zas/mcp-musicbrainz'

If you have feedback or need assistance with the MCP directory API, please join our Discord server