resumePlayback
Resume Spotify music playback on your active device to continue listening where you left off.
Instructions
Resume Spotify playback on the active device
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "resumePlayback"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| deviceId | No | The Spotify device ID to resume playback on |
Implementation Reference
- src/play.ts:283-298 (handler)The handler function for the 'resumePlayback' tool. It destructures the optional deviceId from args, calls handleSpotifyRequest to invoke spotifyApi.player.startResumePlayback on the specified or default device, and returns a success 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' string parameter.
schema: { deviceId: z .string() .optional() .describe('The Spotify device ID to resume playback on'), }, - src/index.ts:12-14 (registration)Registers the 'resumePlayback' tool (included in playTools) with the MCP server by calling server.tool() for each tool in the spread array.
[...readTools, ...playTools, ...albumTools].forEach((tool) => { server.tool(tool.name, tool.description, tool.schema, tool.handler); }); - src/play.ts:369-369 (registration)The 'resumePlayback' tool object is added to the exported playTools array, which is later imported and registered in index.ts.
resumePlayback,