resumePlayback
Resume Spotify playback on the active device using the specified Spotify device ID. Simplifies controlling music playback via the Spotify MCP Server.
Instructions
Resume Spotify playback on the active device
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| deviceId | No | The Spotify device ID to resume playback on |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"deviceId": {
"description": "The Spotify device ID to resume playback on",
"type": "string"
}
},
"type": "object"
}
Implementation Reference
- src/play.ts:283-298 (handler)The asynchronous handler function for the 'resumePlayback' tool. It destructures the optional deviceId from input args, wraps the Spotify API call to startResumePlayback in handleSpotifyRequest, and returns a success text message.handler: async (args, _extra: SpotifyHandlerExtra) => { const { deviceId } = args; await handleSpotifyRequest(async (spotifyApi) => { await spotifyApi.player.startResumePlayback(deviceId || ''); }); return { content: [ { type: 'text', text: 'Playback resumed', }, ], }; },
- src/play.ts:277-282 (schema)Zod input schema for the 'resumePlayback' tool, defining an optional deviceId parameter with description.schema: { deviceId: z .string() .optional() .describe('The Spotify device ID to resume playback on'), },
- src/play.ts:362-371 (registration)Registration of the 'resumePlayback' tool within the exported playTools array, which likely registers the MCP tools.export const playTools = [ playMusic, pausePlayback, skipToNext, skipToPrevious, createPlaylist, addTracksToPlaylist, resumePlayback, addToQueue, ];