Skip to main content
Glama

get_my_playlists

Retrieve your Spotify playlists to view, manage, or organize your music collections directly within your workflow.

Instructions

FastMCP tool to get user playlists using SpotifyClient.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The core handler method in SpotifyClient class that fetches the current user's playlists from Spotify API using spotipy, formats them, and returns as a string.
    async def get_my_playlists(self) -> str:
        """
        Get all playlists for the current user.
        """
        try:
            results = self.sp.current_user_playlists()
            if not results["items"]:
                return "No playlists found."
    
            playlists = []
            for item in results["items"]:
                name = item["name"].encode("ascii", "ignore").decode()
                playlist = (
                    f"Name: {name}\n"
                    f"Tracks: {item['tracks']['total']}\n"
                    f"ID: {item['id']}"
                )
                playlists.append(playlist)
            return "\n---\n".join(playlists)
        except Exception as e:
            return f"Error fetching playlists: {str(e)}"
  • main.py:8-13 (registration)
    Registers the MCP tool 'get_my_playlists' using FastMCP decorator, which calls the SpotifyClient's get_my_playlists method.
    @mcp.tool()
    async def get_my_playlists() -> str:
        """
        FastMCP tool to get user playlists using SpotifyClient.
        """
        return await client.get_my_playlists()
Behavior2/5

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

With no annotations provided, the description carries full burden but only states it 'get user playlists' without disclosing behavioral traits. It doesn't mention whether this requires user authentication, returns all playlists or paginated results, includes public/private status, or handles errors—critical for a read operation in a music API context.

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

Conciseness3/5

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

The description is brief but not optimally structured: 'FastMCP tool' is unnecessary filler, and it lacks front-loaded key details (e.g., scope or constraints). However, it avoids excessive verbosity, keeping to a single sentence that conveys the core action.

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

Completeness2/5

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

Given no annotations and no output schema, the description is incomplete for a tool that likely returns complex playlist data. It doesn't explain what 'user playlists' entails (e.g., owned vs. followed, metadata included), leaving gaps in understanding the tool's behavior and output.

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 input schema has 0 parameters with 100% coverage, so no parameter documentation is needed. The description doesn't add param info, but this is acceptable given the schema completeness, aligning with the baseline for zero parameters.

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

Purpose3/5

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

The description states the tool 'get user playlists using SpotifyClient', which provides a clear verb ('get') and resource ('user playlists'). However, it doesn't differentiate from siblings like 'get_playback_state' or 'get_queue', and the phrase 'FastMCP tool' is redundant noise that doesn't clarify purpose.

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 offers no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., authentication status), nor does it compare to sibling tools like 'search_spotify' or 'get_top_artists' for playlist-related tasks.

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/ashwanth1109/mcp-spotify'

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