Skip to main content
Glama

add_to_queue

Add a Spotify track to your playback queue using its track ID to control music flow during listening sessions.

Instructions

Add a track to the queue
Args:
    track_id: Spotify track ID to add

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
track_idYes

Implementation Reference

  • Core handler function in SpotifyClient that adds a track to the Spotify playback queue by calling the Spotify API.
    async def add_to_queue(self, track_id: str) -> str:
        """
        Add a track to the user's queue.
        - track_id: Spotify track ID to add
        """
        try:
            self.sp.add_to_queue(uri=f"spotify:track:{track_id}")
            return "Track added to queue successfully"
        except Exception as e:
            return f"Error adding track to queue: {str(e)}"
  • main.py:129-136 (registration)
    MCP tool registration using @mcp.tool() decorator. This thin wrapper delegates to the SpotifyClient handler and defines the tool schema via signature and docstring.
    @mcp.tool()
    async def add_to_queue(track_id: str) -> str:
        """
        Add a track to the queue
        Args:
            track_id: Spotify track ID to add
        """
        return await client.add_to_queue(track_id)

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