Skip to main content
Glama

set_repeat_mode

Control Spotify playback repeat settings to loop tracks, playlists, or disable repeat mode using the Spotify MCP server.

Instructions

Set repeat mode for playback Args: state: One of 'track', 'context', or 'off'

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
stateYes

Implementation Reference

  • main.py:178-186 (handler)
    The MCP tool handler function for set_repeat_mode, decorated with @mcp.tool(). It defines the input schema via type hints and docstring, registers the tool, and delegates to SpotifyClient.set_repeat(state).
    @mcp.tool() async def set_repeat_mode(state: str) -> str: """ Set repeat mode for playback Args: state: One of 'track', 'context', or 'off' """ return await client.set_repeat(state)
  • Supporting utility method in the SpotifyClient class that implements the repeat mode functionality using the underlying spotipy Spotify client.
    async def set_repeat(self, state: str) -> str: """ Set repeat mode for playback - state: 'track', 'context' or 'off' """ try: self.sp.repeat(state) return f"Repeat mode set to {state}" except Exception as e: return f"Error setting repeat mode: {str(e)}"

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