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
| Name | Required | Description | Default |
|---|---|---|---|
| area_id | Yes |
Implementation Reference
- mcp_musicbrainz/server.py:601-626 (handler)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()