Skip to main content
Glama

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
NameRequiredDescriptionDefault
deviceIdNoThe Spotify device ID to pause playback on

Implementation Reference

  • 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', }, ], }; },
  • 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); });

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/makesh-kumar/spotify-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server