pausePlayback
Pause Spotify playback on the active device to temporarily stop music without ending your session.
Instructions
Pause Spotify playback on the active device
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| deviceId | No | The Spotify device ID to pause playback on |
Implementation Reference
- src/play.ts:87-102 (handler)The async handler function for the pausePlayback tool, which pauses Spotify playback on the specified or active device using the Spotify API.handler: async (args, _extra: SpotifyHandlerExtra) => { const { deviceId } = args; await handleSpotifyRequest(async (spotifyApi) => { await spotifyApi.player.pausePlayback(deviceId || ''); }); return { content: [ { type: 'text', text: 'Playback paused', }, ], }; },
- src/play.ts:81-86 (schema)Zod input schema for the pausePlayback tool, defining an optional deviceId parameter.schema: { deviceId: z .string() .optional() .describe('The Spotify device ID to pause playback on'), },
- src/play.ts:362-371 (registration)The pausePlayback tool is included in the playTools array, which groups Spotify playback-related tools for export.export const playTools = [ playMusic, pausePlayback, skipToNext, skipToPrevious, createPlaylist, addTracksToPlaylist, resumePlayback, addToQueue, ];
- src/index.ts:12-14 (registration)All tools from playTools (including pausePlayback) are registered with the MCP server by calling server.tool for each.[...readTools, ...playTools, ...albumTools].forEach((tool) => { server.tool(tool.name, tool.description, tool.schema, tool.handler); });