Skip to main content
Glama
zas

MusicBrainz MCP Server

by zas

get_label_details

Retrieve comprehensive metadata for record labels from the MusicBrainz database, including type, location, genres, and official URLs.

Instructions

Get details about a record label including type, area, genres, and URLs.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
label_idYes

Implementation Reference

  • The get_label_details function is defined as an MCP tool to fetch and format details about a record label from the MusicBrainz API.
    def get_label_details(label_id: str) -> str:
        """Get details about a record label including type, area, genres, and URLs."""
        res = musicbrainzngs.get_label_by_id(
            label_id,
            includes=["aliases", "tags", "ratings", "url-rels"],
        )
        lb = res["label"]
        tags = [t["name"] for t in lb.get("tag-list", [])]
        genres = ", ".join(tags) if tags else ""
        aliases = ", ".join(al["alias"] for al in lb.get("alias-list", [])[:10])
        urls = "\n".join(
            f"  - {r['type']}: {r['target']}" for r in lb.get("url-relation-list", [])
        )
        lifespan = lb.get("life-span", {})
        begin = lifespan.get("begin", "?")
        end = lifespan.get("end", "present")
    
        parts = [
            f"Name: {lb['name']}",
            f"Type: {lb.get('type', 'N/A')}",
            f"Country: {lb.get('country', 'N/A')}",
            f"Founded: {begin} to {end}",
            f"Label code: {lb.get('label-code', 'N/A')}",
            f"Genres: {genres or 'None listed'}",
            f"Aliases: {aliases or 'None'}",
            f"MBID: {lb['id']}",
        ]
        if urls:
            parts.append(f"URLs:\n{urls}")
        return "\n".join(parts)

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