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
| Name | Required | Description | Default |
|---|---|---|---|
| deviceId | No | The 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
- src/play.ts:116-131 (handler)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', }, ], }; },
- src/play.ts:110-115 (schema)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,