Skip to main content
Glama
marcelmarais

Spotify MCP Server

by marcelmarais

skipToPrevious

Navigate to the previous track in your current Spotify playback queue. Control playback by specifying a device ID to skip tracks during music listening sessions.

Instructions

Skip to the previous track in the current Spotify playback queue

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
deviceIdNoThe Spotify device ID to skip on

Implementation Reference

  • The handler function for the skipToPrevious tool, which calls the Spotify API to skip to the previous track.
    handler: async (args, _extra: SpotifyHandlerExtra) => {
      const { deviceId } = args;
    
      await handleSpotifyRequest(async (spotifyApi) => {
        await spotifyApi.player.skipToPrevious(deviceId || '');
      });
    
      return {
        content: [
          {
            type: 'text',
            text: 'Skipped to previous track',
          },
        ],
      };
    },
  • Input schema for the skipToPrevious tool using Zod, defining optional deviceId.
    schema: {
      deviceId: z
        .string()
        .optional()
        .describe('The Spotify device ID to skip on'),
    },
  • src/play.ts:499-510 (registration)
    The skipToPrevious tool is registered in the playTools export array.
    export const playTools = [
      playMusic,
      pausePlayback,
      skipToNext,
      skipToPrevious,
      createPlaylist,
      addTracksToPlaylist,
      resumePlayback,
      addToQueue,
      setVolume,
      adjustVolume,
    ];
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It mentions the action but doesn't disclose behavioral traits like whether this requires active playback, what happens if no previous track exists, if it affects shuffle/repeat modes, or any error conditions. The description is minimal and lacks operational context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, direct sentence that efficiently conveys the tool's purpose without unnecessary words. It's front-loaded with the core action and resource, making it easy to understand at a glance. Every word serves a clear purpose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of a playback control tool with no annotations and no output schema, the description is insufficient. It doesn't explain what happens on invocation (e.g., success/failure states, return values), prerequisites like active playback, or how it interacts with other playback tools. For a mutation tool, more behavioral context is needed.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 100%, so the schema already documents the deviceId parameter. The description doesn't add any parameter-specific information beyond what the schema provides, but with only one optional parameter, the baseline is high. No additional semantics are provided, but the minimal parameter count reduces the need for extra detail.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('skip to the previous track') and the resource ('current Spotify playback queue'), distinguishing it from sibling tools like skipToNext (next track) and pausePlayback/resumePlayback (playback control). It uses specific verbs and identifies the exact scope of operation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage when the user wants to go back to a previous track in the queue, but it doesn't explicitly state when to use this tool versus alternatives like skipToNext or getQueue. No exclusions or prerequisites are mentioned, leaving some ambiguity about context.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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