Skip to main content
Glama

cancel_sleep_timer

Stop an active sleep timer in Spotify to continue playback without interruption. Cancel specific timers or all active ones to maintain continuous music streaming.

Instructions

Cancel an active sleep timer

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
timerIdNoOptional timer ID to cancel specific timer, or omit to cancel all

Implementation Reference

  • Core implementation of the cancel_sleep_timer tool. Cancels a specific timer by ID or all active timers, returning success status and message.
    export async function cancelSleepTimer(timerManager: TimerManager, timerId?: string) { if (timerId) { const cancelled = timerManager.cancelTimer(timerId); if (!cancelled) { throw new Error(`Timer ${timerId} not found`); } return { success: true, message: `Timer ${timerId} cancelled`, }; } else { const count = timerManager.cancelAllTimers(); return { success: true, message: `Cancelled ${count} timer(s)`, cancelledCount: count, }; } }
  • Defines the tool schema for cancel_sleep_timer, including name, description, and input schema with optional timerId.
    { name: 'cancel_sleep_timer', description: 'Cancel an active sleep timer', inputSchema: { type: 'object', properties: { timerId: { type: 'string', description: 'Optional timer ID to cancel specific timer, or omit to cancel all', }, }, }, },
  • src/server.ts:377-389 (registration)
    Registers and dispatches the cancel_sleep_timer tool call by invoking the timerTools.cancelSleepTimer function.
    case 'cancel_sleep_timer': const cancelResult = await timerTools.cancelSleepTimer( timerManager, args?.timerId as string | undefined ); return { content: [ { type: 'text', text: JSON.stringify(cancelResult, null, 2), }, ], };

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/Ackberry/spotify_mcp'

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