Skip to main content
Glama
Cifero74

mcp-apple-music

search_catalog

Search the Apple Music catalog to find songs, albums, artists, or playlists using specific search terms and filters.

Instructions

Search the Apple Music catalog for songs, albums, artists, or playlists.

Args: query: Search term (e.g. "Radiohead", "Bohemian Rhapsody"). types: Comma-separated resource types to include. Options: songs, albums, artists, playlists (default: songs,albums,artists) limit: Results per type, 1–25 (default 5).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYes
typesNosongs,albums,artists
limitNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • Implementation of the 'search_catalog' tool. It interacts with the Apple Music catalog API based on the provided query and filters.
    @mcp.tool()
    async def search_catalog(
        query: str,
        types: str = "songs,albums,artists",
        limit: int = 5,
    ) -> str:
        """Search the Apple Music catalog for songs, albums, artists, or playlists.
    
        Args:
            query: Search term (e.g. "Radiohead", "Bohemian Rhapsody").
            types: Comma-separated resource types to include.
                   Options: songs, albums, artists, playlists  (default: songs,albums,artists)
            limit: Results per type, 1–25 (default 5).
        """
        client = _get_client()
        storefront = client.auth.get_storefront()
        data = await client.get(
            f"/catalog/{storefront}/search",
            params={"term": query, "types": types, "limit": min(max(1, limit), 25)},
            user_auth=False,
        )
        results = data.get("results", {})
        lines = [f"šŸ” Catalog search: '{query}'\n"]
    
        if songs := results.get("songs", {}).get("data", []):
            lines.append("šŸŽµ Songs:")
            for i, s in enumerate(songs, 1):
                lines.append(_fmt_song(s, i))
    
        if albums := results.get("albums", {}).get("data", []):
            lines.append("\nšŸ’æ Albums:")
            for i, a in enumerate(albums, 1):
                lines.append(_fmt_album(a, i))
    
        if artists := results.get("artists", {}).get("data", []):
            lines.append("\nšŸ‘¤ Artists:")
            for i, a in enumerate(artists, 1):
                lines.append(_fmt_artist(a, i))
    
        if playlists := results.get("playlists", {}).get("data", []):
            lines.append("\nšŸ“‹ Playlists:")
            for i, p in enumerate(playlists, 1):
                a = p.get("attributes", {})
                lines.append(
                    f"  {i}. {a.get('name', '?')} — {a.get('curatorName', '')} | ID: {p.get('id', '?')}"
                )
    
        if len(lines) == 1:
            return f"No results found for '{query}'."
        return "\n".join(lines)
    
    
    # ------------------------------------------------------------------ #
    #  Tool: search_library                                               #
    # ------------------------------------------------------------------ #
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full disclosure burden. It clearly states the search scope but lacks details on rate limits, authentication requirements, or pagination behavior beyond the 'limit' parameter. Defaults are documented, which provides some behavioral context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description uses an efficient structure: a single summary sentence followed by a structured Args section. Every line provides specific constraints, examples, or defaults. No redundant or filler text is present.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the presence of an output schema, the description appropriately focuses on input parameters and search scope. It adequately covers the 3 parameters despite zero schema coverage. A brief note explicitly contrasting 'catalog' vs 'library' search would improve contextual completeness given the sibling tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage, the description fully compensates by documenting all three parameters: 'query' includes concrete examples (Radiohead, Bohemian Rhapsody), 'types' specifies valid options and default value, and 'limit' provides the valid range (1-25) and default.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description provides a specific verb (Search) and resource (Apple Music catalog) with clear scope (songs, albums, artists, playlists). However, it does not explicitly distinguish from the sibling tool 'search_library', though the use of 'catalog' vs 'library' in the names provides implicit differentiation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage by specifying 'Apple Music catalog', suggesting public content vs personal library, but provides no explicit guidance on when to choose this over 'search_library' or other alternatives. No when-not-to-use or prerequisite information is included.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/Cifero74/mcp-apple-music'

If you have feedback or need assistance with the MCP directory API, please join our Discord server