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)}"
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It states the action ('Set repeat mode') which implies a mutation, but doesn't disclose critical behavioral traits: whether this requires specific permissions, if changes are immediate or reversible, potential side effects on playback, or what happens on failure. The description is minimal and lacks operational context.

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 perfectly concise and well-structured. The first sentence states the core purpose, followed by a clear 'Args:' section that documents the parameter without unnecessary elaboration. Every sentence earns its place, and information is front-loaded for quick comprehension.

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 moderate complexity (mutation with one parameter) and lack of both annotations and output schema, the description is minimally adequate but has clear gaps. It explains what the tool does and documents the parameter well, but omits behavioral context, error handling, and relationship to other playback tools. For a mutation tool with no structured safety hints, more completeness would be beneficial.

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 description adds significant value beyond the input schema, which has 0% description coverage. It explicitly documents the 'state' parameter's allowed values ('track', 'context', or 'off'), providing essential semantics that the schema alone lacks. For a single parameter tool with poor schema coverage, this effectively compensates by fully explaining the parameter's meaning and valid options.

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 verb 'Set' and the resource 'repeat mode for playback', making the purpose immediately understandable. It distinguishes from siblings like 'get_playback_state' or 'start_playback' by focusing specifically on repeat mode configuration rather than general playback control or status retrieval.

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 prerequisites (e.g., requires active playback), when-not-to-use scenarios, or how it relates to similar tools like 'start_playback' or 'get_playback_state'. The agent must infer usage from context 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/ashwanth1109/mcp-spotify'

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