Skip to main content
Glama

skipToNext

Skip the current track and play the next one in your Spotify playback queue. Specify the device ID to control playback on a specific device.

Instructions

Skip to the next track in the current Spotify playback queue

Input Schema

NameRequiredDescriptionDefault
deviceIdNoThe Spotify device ID to skip on

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "deviceId": { "description": "The Spotify device ID to skip on", "type": "string" } }, "type": "object" }

Implementation Reference

  • The handler function that executes the tool logic by calling the Spotify API's skipToNext method on the specified or default device.
    handler: async (args, _extra: SpotifyHandlerExtra) => { const { deviceId } = args; await handleSpotifyRequest(async (spotifyApi) => { await spotifyApi.player.skipToNext(deviceId || ''); }); return { content: [ { type: 'text', text: 'Skipped to next track', }, ], }; },
  • Zod schema for input validation, defining the optional deviceId parameter.
    schema: { deviceId: z .string() .optional() .describe('The Spotify device ID to skip on'), },
  • src/index.ts:12-14 (registration)
    Registers all tools from playTools (including skipToNext) with the MCP server via a loop.
    [...readTools, ...playTools, ...albumTools].forEach((tool) => { server.tool(tool.name, tool.description, tool.schema, tool.handler); });
  • src/play.ts:365-365 (registration)
    Includes the skipToNext tool in the exported playTools array for batch registration.
    skipToNext,

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/marcelmarais/spotify-mcp-server'

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