Skip to main content
Glama
zas

MusicBrainz MCP Server

by zas

search_entities

Search the MusicBrainz database for artists, albums, recordings, labels, and other music entities using structured queries to find specific music metadata.

Instructions

Search for any MusicBrainz entity (artist, release, recording, label, work, release-group, area, event, instrument, place, series). Supports Lucene syntax. Example queries:

  • 'artist:Nirvana AND country:US'

  • 'release:Nevermind'

  • 'recording:"Smells Like Teen Spirit"' PRIMARY DATA SOURCE. Search for artists, releases, or recordings. If an exact search (e.g., 'artist:Name') returns 0 results, try a broader search with just the name string. If still 0 results, use search_entities_fuzzy for typo-tolerant matching.

Entity hierarchy (IDs are NOT interchangeable):

  • artist: a person or group

  • release-group: an "album" concept (e.g. "Nevermind") — has type (Album, EP, Single)

  • release: a specific edition of a release-group (e.g. US CD vs JP vinyl)

    • a release contains one or more media (disc 1, disc 2, etc.)

    • each medium contains tracks (with position and optional title override)

  • recording: a unique audio track (a song). Tracks on a release point to recordings.

  • work: an abstract composition (lyrics + music), independent of any recording

  • label: a record label that publishes releases (not release-groups)

Every ID returned is an MBID (UUID) bound to a specific entity type. An MBID from a release-group CANNOT be used as a release_id, and vice versa. Always track which entity type an ID belongs to and pass it to the matching tool.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
entity_typeYes
queryYes
limitNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The search_entities function acts as a dispatcher, validating the entity type and using the SEARCH_FUNCS map to call the appropriate musicbrainzngs search function, then formatting the results.
    def search_entities(entity_type: str, query: str, limit: int = 5) -> str:
        """
        Search for any MusicBrainz entity (artist, release, recording, label, work,
        release-group, area, event, instrument, place, series).
        Supports Lucene syntax. Example queries:
        - 'artist:Nirvana AND country:US'
        - 'release:Nevermind'
        - 'recording:"Smells Like Teen Spirit"'
        PRIMARY DATA SOURCE. Search for artists, releases, or recordings.
        If an exact search (e.g., 'artist:Name') returns 0 results,
        try a broader search with just the name string.
        If still 0 results, use search_entities_fuzzy for typo-tolerant matching.
    
        Entity hierarchy (IDs are NOT interchangeable):
        - artist: a person or group
        - release-group: an "album" concept (e.g. "Nevermind")
          — has type (Album, EP, Single)
        - release: a specific edition of a release-group (e.g. US CD vs JP vinyl)
          - a release contains one or more media (disc 1, disc 2, etc.)
          - each medium contains tracks (with position and optional title override)
        - recording: a unique audio track (a song). Tracks on a release point to recordings.
        - work: an abstract composition (lyrics + music), independent of any recording
        - label: a record label that publishes releases (not release-groups)
    
        Every ID returned is an MBID (UUID) bound to a specific entity type.
        An MBID from a release-group CANNOT be used as a release_id, and vice versa.
        Always track which entity type an ID belongs to and pass it to the matching tool.
        """
        if entity_type not in SEARCH_FUNCS:
            return (
                f"Invalid entity type '{entity_type}'. "
                f"Choose from: {', '.join(SEARCH_FUNCS)}"
            )
        result = SEARCH_FUNCS[entity_type](query=query, limit=limit)
        list_key = f"{entity_type.replace('-', '_')}-list"
        items = result.get(list_key, [])
        lines = [f"Found {len(items)} results for {entity_type}:"]
        for i in items:
            name = i.get("name") or i.get("title")
            disambig = i.get("disambiguation", "")
            extra = f" ({disambig})" if disambig else ""
            lines.append(f"- {name}{extra} | {entity_type} ID: {i['id']}")
        return "\n".join(lines)
    
    
    @mcp.tool()
    @cached_tool()
    def browse_entities(
        entity_type: str,
        linked_type: str,
        linked_id: str,
        limit: int = 25,
        offset: int = 0,
    ) -> str:
        """
        Browse MusicBrainz entities linked to another entity, with paging.
        Useful for getting complete discographies, all releases on a label, etc.
    
        Common combinations:
        - release-groups by artist: full discography
        - releases by release_group: all editions of an album
        - releases by label: label's catalog
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden and does well by disclosing key behaviors: it supports Lucene syntax, explains entity hierarchy and ID constraints (MBIDs are type-specific and not interchangeable), and warns about search fallbacks. However, it doesn't mention rate limits, authentication needs, or pagination details, which keeps it from a perfect score.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured and front-loaded with the core purpose, followed by examples, usage guidelines, and entity hierarchy. Most sentences earn their place, but it could be slightly more concise by integrating some hierarchical details more tightly without losing clarity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of the tool (multiple entity types, Lucene syntax, sibling alternatives) and the presence of an output schema (which handles return values), the description is complete. It covers purpose, usage, behavioral traits, parameter context, and entity relationships, providing all necessary context for effective use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. It adds significant meaning beyond the schema by explaining that 'entity_type' includes specific options like artist or release, and 'query' supports Lucene syntax with examples. However, it doesn't explicitly detail the 'limit' parameter's default or range, leaving a minor gap.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool searches for MusicBrainz entities with specific examples of entity types (artist, release, recording, etc.) and distinguishes it from siblings by explicitly mentioning 'search_entities_fuzzy' as an alternative for typo-tolerant matching. It goes beyond just restating the name by explaining it's the 'PRIMARY DATA SOURCE' for searching artists, releases, or recordings.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit guidance on when to use this tool versus alternatives: it specifies to use 'search_entities_fuzzy' if exact and broader searches return 0 results. It also distinguishes from sibling tools by indicating this is for general entity searching, while others like 'get_artist_details' or 'search_artists' serve more specific purposes.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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