transfer_playback
Transfer active Spotify playback to another device while maintaining position, queue, and settings. Ideal for switching between phone, speakers, or car systems seamlessly.
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
| Name | Required | Description | Default |
|---|---|---|---|
| deviceId | Yes | The ID of the device to transfer playback to | |
| play | No | ||
| token | Yes | Spotify access token for authentication |
Implementation Reference
- src/mcp/tools/playback.ts:495-498 (handler)The MCP tool handler for 'transfer_playback', which extracts arguments and delegates to SpotifyService.transferPlayback.handler: async (args: any, spotifyService: SpotifyService) => { const { token, deviceId, play = false } = args; return await spotifyService.transferPlayback(token, deviceId, play); },
- src/mcp/tools/playback.ts:485-494 (schema)Zod-based input schema for the transfer_playback tool, defining token, deviceId, and optional 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"), }),
- src/mcp/tools/index.ts:22-36 (registration)Central tool registry where playbackTools (containing transfer_playback) is spread into allTools for MCP integration.export const allTools: ToolsRegistry = { ...albumTools, ...artistTools, ...trackTools, ...playlistTools, ...playbackTools, ...userTools, ...searchTools, };
- src/spotify.ts:714-724 (helper)Core implementation in SpotifyService that makes the Spotify API PUT request to /me/player to transfer 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); }