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
| Name | Required | Description | Default |
|---|---|---|---|
| entity_type | Yes | ||
| query | Yes | ||
| limit | No |
Implementation Reference
- mcp_musicbrainz/server.py:765-782 (handler)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)