spotify_resume
Resume paused Spotify playback on your preferred device to continue listening to music or podcasts where you left off.
Instructions
Retoma a reprodução pausada
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| device_id | No | ID do dispositivo (opcional) |
Implementation Reference
- src/tools/spotify-tools.ts:213-239 (handler)The `resume` method in the `SpotifyTools` class implements the core logic for resuming Spotify playback by calling `spotifyApi.play()` after ensuring a valid access token.async resume(deviceId?: string) { try { await this.spotifyAuth.ensureValidToken(); const spotifyApi = this.spotifyAuth.getSpotifyApi(); const options = deviceId ? { device_id: deviceId } : {}; await spotifyApi.play(options); return { content: [ { type: 'text', text: '▶️ Reprodução retomada', }, ], }; } catch (error) { return { content: [ { type: 'text', text: `❌ Erro ao retomar: ${error instanceof Error ? error.message : String(error)}`, }, ], }; } }
- src/index.ts:122-134 (schema)Input schema definition for the `spotify_resume` tool, specifying an optional `device_id` parameter.{ name: 'spotify_resume', description: 'Retoma a reprodução pausada', inputSchema: { type: 'object', properties: { device_id: { type: 'string', description: 'ID do dispositivo (opcional)', }, }, }, },
- src/index.ts:277-278 (registration)Registration of the `spotify_resume` tool in the MCP server's request handler switch statement, dispatching to the `SpotifyTools.resume` method.case 'spotify_resume': return await spotifyTools.resume(args.device_id);