Skip to main content
Glama

itunes_library

Get a summary of your Apple Music library, including total tracks and user playlists, to manage your music collection effectively.

Instructions

Return a summary of the Music library, including total tracks and user playlists.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The handler function for the 'itunes_library' tool. It uses an AppleScript script executed via the shared 'run_applescript' helper to query the Music application's library for total tracks and playlists, returning a summary string.
    @mcp.tool()
    def itunes_library() -> str:
        """
        Return a summary of the Music library, including total tracks and user playlists.
        """
        script = """
        tell application "Music"
            set totalTracks to count of every track of playlist "Library"
            set totalPlaylists to count of user playlists
            return "Total tracks: " & totalTracks & linefeed & "Total playlists: " & totalPlaylists
        end tell
        """
        return run_applescript(script)
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool returns a summary, implying a read-only operation, but doesn't specify whether it requires permissions, has rate limits, or what the output format looks like (though an output schema exists). For a tool with zero annotation coverage, this is a significant gap in transparency.

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 is a single, efficient sentence: 'Return a summary of the Music library, including total tracks and user playlists.' It's front-loaded with the core purpose and includes specific details (total tracks, user playlists) without unnecessary words. Every part of the sentence adds value.

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

Completeness3/5

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

Given the tool's simplicity (0 parameters, output schema provided), the description is adequate but has gaps. It clearly states what the tool does, but without annotations, it lacks behavioral context like safety or performance hints. The output schema handles return values, so the description doesn't need to explain those. However, for a read operation with sibling tools, more usage guidance would improve completeness.

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

Parameters4/5

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

The tool has 0 parameters, and schema description coverage is 100%, so the schema fully documents the lack of inputs. The description doesn't need to add parameter details, and it doesn't introduce any confusion. A baseline of 4 is appropriate for a zero-parameter tool with complete schema coverage.

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 clearly states the tool's purpose: 'Return a summary of the Music library, including total tracks and user playlists.' It specifies the verb ('Return a summary') and resource ('Music library'), and distinguishes it from siblings like 'itunes_all_songs' (which likely lists all songs) and 'itunes_search' (which searches). However, it doesn't explicitly differentiate from 'itunes_current_song' or other playback tools, keeping it at a 4.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention when to choose 'itunes_library' over 'itunes_all_songs' for getting track information or 'itunes_search' for finding specific content. There's no context on prerequisites or exclusions, leaving the agent to infer usage based on tool names alone.

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/kennethreitz/mcp-applemusic'

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