Skip to main content
Glama

reorder_queue

Move a track to a different position in your Spotify queue to customize playback order.

Instructions

Reorder tracks in queue by moving a track to a different position
Args:
    range_start: Position of track to move
    insert_before: Position to insert the track

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
range_startYes
insert_beforeYes

Implementation Reference

  • main.py:199-208 (handler)
    MCP tool handler for 'reorder_queue', decorated with @mcp.tool(). Delegates to SpotifyClient.reorder_queue.
    @mcp.tool()
    async def reorder_queue(range_start: int, insert_before: int) -> str:
        """
        Reorder tracks in queue by moving a track to a different position
        Args:
            range_start: Position of track to move
            insert_before: Position to insert the track
        """
        return await client.reorder_queue(range_start, insert_before)
  • SpotifyClient method implementing the queue reordering logic using spotipy's queue_reorder.
    async def reorder_queue(self, range_start: int, insert_before: int) -> str:
        """
        Reorder tracks in queue by moving a track to a different position
        - range_start: Position of track to move (0-based)
        - insert_before: Position to insert the track (0-based)
        """
        try:
            # Note: Spotify's queue reordering is done through a special endpoint
            # that requires both positions to be 0-based
            self.sp.queue_reorder(
                range_start=range_start,
                insert_before=insert_before,
                range_length=1,  # Move one track at a time
            )
            return "Queue reordered successfully"
        except Exception as e:
            return f"Error reordering queue: {str(e)}"
  • main.py:199-199 (registration)
    The @mcp.tool() decorator registers the reorder_queue function as an MCP tool.
    @mcp.tool()
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool reorders tracks, implying a mutation operation, but doesn't describe side effects (e.g., whether this affects playback state, requires specific permissions, or has rate limits), error conditions, or what happens if parameters are invalid. This leaves significant gaps for a mutation tool.

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 front-loaded with the core purpose in the first sentence, followed by parameter explanations. It's appropriately sized with no wasted words, though the parameter section could be slightly more integrated into the flow rather than listed separately.

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 that this is a mutation tool with no annotations, 0% schema description coverage, and no output schema, the description is incomplete. It lacks information on behavioral traits (e.g., side effects, error handling), usage context, and output expectations, which are critical for safe and effective tool invocation.

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 schema description coverage is 0%, so the description must compensate. It adds meaningful context by explaining that 'range_start' is the 'Position of track to move' and 'insert_before' is the 'Position to insert the track', which clarifies the semantics beyond the bare schema. However, it doesn't specify index conventions (e.g., zero-based vs. one-based) or constraints, leaving some ambiguity.

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 action ('reorder tracks in queue') and the specific operation ('by moving a track to a different position'), which is a specific verb+resource combination. However, it doesn't explicitly distinguish this tool from sibling tools like 'skip_tracks' or 'add_to_queue', which also affect queue ordering, so it doesn't fully differentiate from alternatives.

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., whether a queue must exist or playback be active), exclusions, or comparisons to sibling tools like 'skip_tracks' or 'add_to_queue' that might affect queue ordering in different ways.

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