Skip to main content
Glama

cancel_sleep_timer

Stop a running sleep timer to continue Spotify playback without interruption. Cancel specific timers or all active ones to maintain your listening session.

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

  • The core handler function that implements the cancel_sleep_timer tool. It cancels a specific timer by ID or all timers if no ID provided, using the TimerManager.
    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, }; } }
  • The input schema definition for the cancel_sleep_timer tool, provided in the MCP listTools response.
    { 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:325-337 (registration)
    The registration/dispatch handler in the MCP CallToolRequest switch statement that invokes the 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