Skip to main content
Glama

transfer_playback

Transfer active Spotify playback between devices while preserving playback position, queue, and settings for continuous listening across different locations.

Instructions

Seamlessly transfer active playback from one device to another while maintaining playback state.

🎯 USE CASES: • Move music from phone to home speakers when arriving home • Switch from desktop to phone when leaving office • Transfer playback to car system when starting drive • Move music between rooms using different smart speakers • Continue listening on different devices without interruption

📝 WHAT IT RETURNS: • Confirmation of successful transfer • New active device information • Preserved playback position and queue • Current track information on new device • Transfer success status and any error details

🔍 EXAMPLES: • "Transfer playback to my bedroom speaker" • "Move music to my phone" • "Switch playback to device ID: 1a2b3c4d5e6f" • "Continue playing on my laptop"

🔄 TRANSFER FEATURES: • Maintains exact playback position • Preserves queue, shuffle, and repeat settings • Keeps volume level appropriate for target device • Option to start playing immediately or stay paused • Seamless transition with minimal interruption

💡 SMART HANDOFFS: • Perfect for multi-room audio setups • Enables mobility without losing music context • Great for smart home automation scenarios • Supports lifestyle-based listening patterns

⚠️ REQUIREMENTS: • Valid Spotify access token with user-modify-playback-state scope • Target device must be available and online • User must have control permissions for target device

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tokenYesSpotify access token for authentication
deviceIdYesThe ID of the device to transfer playback to
playNo

Implementation Reference

  • Core handler function in SpotifyService that makes the API call to transfer playback to the specified device_id, optionally starting playback.
    async transferPlayback(
      token: string,
      deviceId: string,
      play: boolean = false
    ): Promise<void> {
      const data = {
        device_ids: [deviceId],
        play: play,
      };
      return await this.makeRequest<void>("me/player", token, {}, "PUT", data);
    }
  • Input schema definition using Zod for the transfer_playback tool, validating token, deviceId, and play parameters.
    schema: createSchema({
      token: commonSchemas.token(),
      deviceId: z
        .string()
        .describe("The ID of the device to transfer playback to"),
      play: z
        .boolean()
        .default(false)
        .describe("Whether to start playing immediately after transfer"),
    }),
  • Tool registration object defining transfer_playback, including title, description, schema, and handler that invokes SpotifyService.transferPlayback.
      transfer_playback: {
        title: "Transfer Playback",
        description: `Seamlessly transfer active playback from one device to another while maintaining playback state.
    
    🎯 USE CASES:
    • Move music from phone to home speakers when arriving home
    • Switch from desktop to phone when leaving office
    • Transfer playback to car system when starting drive
    • Move music between rooms using different smart speakers
    • Continue listening on different devices without interruption
    
    📝 WHAT IT RETURNS:
    • Confirmation of successful transfer
    • New active device information
    • Preserved playback position and queue
    • Current track information on new device
    • Transfer success status and any error details
    
    🔍 EXAMPLES:
    • "Transfer playback to my bedroom speaker"
    • "Move music to my phone"
    • "Switch playback to device ID: 1a2b3c4d5e6f"
    • "Continue playing on my laptop"
    
    🔄 TRANSFER FEATURES:
    • Maintains exact playback position
    • Preserves queue, shuffle, and repeat settings
    • Keeps volume level appropriate for target device
    • Option to start playing immediately or stay paused
    • Seamless transition with minimal interruption
    
    💡 SMART HANDOFFS:
    • Perfect for multi-room audio setups
    • Enables mobility without losing music context
    • Great for smart home automation scenarios
    • Supports lifestyle-based listening patterns
    
    ⚠️ REQUIREMENTS:
    • Valid Spotify access token with user-modify-playback-state scope
    • Target device must be available and online
    • User must have control permissions for target device`,
        schema: createSchema({
          token: commonSchemas.token(),
          deviceId: z
            .string()
            .describe("The ID of the device to transfer playback to"),
          play: z
            .boolean()
            .default(false)
            .describe("Whether to start playing immediately after transfer"),
        }),
        handler: async (args: any, spotifyService: SpotifyService) => {
          const { token, deviceId, play = false } = args;
          return await spotifyService.transferPlayback(token, deviceId, play);
        },
      },
  • Aggregates all tools including playbackTools (containing transfer_playback) into allTools registry used by ToolRegistrar for MCP.
    export const allTools: ToolsRegistry = {
      ...albumTools,
    
      ...artistTools,
    
      ...trackTools,
    
      ...playlistTools,
    
      ...playbackTools,
    
      ...userTools,
    
      ...searchTools,
    };
Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively describes key behavioral traits: it's a mutation operation (implied by 'transfer'), preserves playback state (position, queue, settings), handles transitions with minimal interruption, and includes requirements like authentication scope and device availability. However, it doesn't mention potential side effects like rate limits or error handling details beyond 'any error details'.

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 well-structured with clear sections (USE CASES, WHAT IT RETURNS, etc.), but it's overly verbose with 8 sections including redundant marketing-like phrases ('Seamlessly', 'Perfect for', 'Great for'). Many sentences don't earn their place for pure tool selection, such as the 'SMART HANDOFFS' section which repeats use case concepts. It could be more concise while maintaining clarity.

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

Completeness4/5

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

Given 3 parameters, no annotations, and no output schema, the description does a good job covering purpose, usage, behavior, and requirements. The 'WHAT IT RETURNS' section compensates for the missing output schema by detailing response content. However, it lacks explicit error scenarios or performance characteristics, leaving some gaps for a mutation tool with authentication needs.

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?

Schema description coverage is 67% (2 of 3 parameters have descriptions). The description doesn't explicitly discuss parameters in a dedicated section, but it provides contextual meaning: 'deviceId' is implied through examples and use cases, and 'play' is indirectly covered in 'TRANSFER FEATURES' ('Option to start playing immediately or stay paused'). This adds useful semantics beyond the schema, though not comprehensively for all parameters.

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

Purpose5/5

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

The description clearly states the specific action ('transfer active playback from one device to another') and resource ('playback state'), distinguishing it from all sibling tools which handle different operations like searching, getting data, or controlling playback without transfer. The title 'Seamlessly transfer active playback...' provides a precise verb+resource combination that is unique in the toolset.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit guidance on when to use this tool through dedicated 'USE CASES' and 'SMART HANDOFFS' sections, listing scenarios like moving music between devices when changing locations. It also specifies 'REQUIREMENTS' that implicitly indicate when not to use it (e.g., without valid token or offline target device), though it doesn't name specific alternative tools from the sibling list.

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/latiftplgu/Spotify-OAuth-MCP-server'

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