Skip to main content
Glama
zas

MusicBrainz MCP Server

by zas

search_entities_fuzzy

Find music entities with typo-tolerant search. Handles misspellings by trying exact matches first, then fuzzy matching for artists, releases, recordings, labels, and works in the MusicBrainz database.

Instructions

Typo-tolerant fuzzy search. Tries an exact search first, then falls back to fuzzy matching if no results are found. Supports 'artist', 'release', 'recording', 'label', and 'work'. Use when the query may contain misspellings (e.g., 'Bjork' -> 'Björk').

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
entity_typeYes
queryYes
limitNo

Implementation Reference

  • The `search_entities_fuzzy` tool implementation, which wraps `search_entities` with fuzzy query formatting.
    @mcp.tool()
    @cached_tool()
    def search_entities_fuzzy(entity_type: str, query: str, limit: int = 5) -> str:
        """
        Typo-tolerant fuzzy search. Tries an exact search first, then falls back to
        fuzzy matching if no results are found.
        Supports 'artist', 'release', 'recording', 'label', and 'work'.
        Use when the query may contain misspellings (e.g., 'Bjork' -> 'Björk').
        """
        # Try exact search first
        exact = search_entities(entity_type=entity_type, query=query, limit=limit)
        if not exact.startswith("Found 0"):
            return exact
    
        # Fall back to fuzzy matching
        fuzzy_query = " ".join([f"{word}~" for word in query.split()])
        return search_entities(entity_type=entity_type, query=fuzzy_query, limit=limit)

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