Skip to main content
Glama
zas

MusicBrainz MCP Server

by zas

get_area_details

Retrieve geographic area information from the MusicBrainz database to identify music-related locations like countries and cities.

Instructions

Get details about a geographic area (country, city).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
area_idYes

Implementation Reference

  • The implementation of the get_area_details tool, which is registered with @mcp.tool() and decorated with @cached_tool(). It fetches area details from the MusicBrainz API and formats them into a readable string.
    @mcp.tool()
    @cached_tool()
    def get_area_details(area_id: str) -> str:
        """Get details about a geographic area (country, city)."""
        res = musicbrainzngs.get_area_by_id(
            area_id,
            includes=["aliases", "url-rels"],
        )
        a = res["area"]
        aliases = ", ".join(al["alias"] for al in a.get("alias-list", [])[:10])
        lifespan = a.get("life-span", {})
        begin = lifespan.get("begin", "?")
        end = lifespan.get("end", "present")
    
        parts = [
            f"Name: {a['name']}",
            f"Type: {a.get('type', 'N/A')}",
            f"Life-span: {begin} to {end}",
            f"Aliases: {aliases or 'None'}",
            f"MBID: {area_id}",
        ]
        return "\n".join(parts)
    
    
    @mcp.tool()
    @cached_tool()

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