Skip to main content
Glama

itunes_all_songs

Retrieve all songs from your Apple Music library to view a formatted list of tracks with artist names.

Instructions

Get a list of all songs in the Music library. Returns a formatted list of all tracks with their names and artists.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The handler function for the 'itunes_all_songs' tool. It uses AppleScript to fetch all tracks from the Music app's Library playlist and returns a list formatted as 'Track Name - Artist' for each track. The @mcp.tool() decorator registers it as an MCP tool.
    @mcp.tool()
    def itunes_all_songs() -> str:
        """
        Get a list of all songs in the Music library.
        Returns a formatted list of all tracks with their names and artists.
        """
        script = """
        tell application "Music"
            set trackList to every track of playlist "Library"
            set output to ""
            repeat with t in trackList
                set output to output & (name of t) & " - " & (artist of t) & linefeed
            end repeat
            return output
        end tell
        """
        return run_applescript(script)
  • Shared helper function used by itunes_all_songs (and other tools) to execute AppleScript commands via the osascript subprocess.
    def run_applescript(script: str) -> str:
        """Execute an AppleScript command via osascript and return its output."""
        result = subprocess.run(["osascript", "-e", script], capture_output=True, text=True)
        if result.returncode != 0:
            return f"Error: {result.stderr.strip()}"
        return result.stdout.strip()
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions that it 'Returns a formatted list of all tracks with their names and artists,' which adds some context about the output format. However, it fails to disclose critical behavioral traits such as whether this is a read-only operation, potential performance impacts for large libraries, or any rate limits. For a tool with zero annotation coverage, this is insufficient.

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

Conciseness4/5

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

The description is concise and front-loaded, consisting of two sentences that directly state the purpose and output. There is no wasted text, and it efficiently communicates the essential information. However, it could be slightly improved by integrating usage hints, but as-is, it's well-structured.

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 low complexity (0 parameters, output schema exists), the description is somewhat complete but has gaps. It explains what the tool does and the return format, but lacks behavioral context and usage guidelines. The output schema likely covers return values, so the description doesn't need to detail them. However, for a tool with no annotations, it should provide more behavioral transparency to be fully adequate.

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 there are no parameters to document. The description doesn't need to add parameter semantics, and it appropriately doesn't mention any. A baseline of 4 is applied for zero parameters, as it avoids unnecessary information.

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: 'Get a list of all songs in the Music library.' It specifies the verb ('Get') and resource ('all songs'), distinguishing it from siblings like itunes_play_song or itunes_search. However, it doesn't explicitly differentiate from itunes_library, which might have overlapping functionality, preventing a perfect score.

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. For example, it doesn't clarify if this should be used instead of itunes_library for song-specific lists or how it compares to itunes_search for filtered results. This lack of context leaves the agent without clear usage instructions.

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