Skip to main content
Glama
Spotify MCP Server

Spotify MCP Server

by jamiew

Control Playback

control_playback

Control Spotify playback by playing, pausing, skipping tracks, seeking, adjusting volume, and toggling shuffle or repeat on a Premium account with an active device.

Instructions

Control Spotify playback. Requires Premium and an active device.

Args:
    action: 'play', 'pause', 'next', 'previous', 'seek', 'volume', 'shuffle' or 'repeat'
    track_ids: Tracks or episodes to play (action='play'; ignored when
        context_uri is set). Bare IDs are tracks; pass spotify:episode: URIs
        or episode share URLs for podcast episodes.
    context_uri: Album, playlist, artist or show URI to play (action='play')
    position_ms: Position in milliseconds (required for action='seek')
    volume_percent: Volume 0-100 (required for action='volume')
    state: 'on'/'off' for shuffle; 'track'/'context'/'off' for repeat
    device_id: Target device (default: the currently active one)

Returns:
    Last observed PlaybackState, possibly unconfirmed.

Confirmation is best effort: at most five post-action reads with brief waits.
Stale state or a later read failure returns the last observation. Checks do not
verify every requested track, context or device transition.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "action": "<action>"
    },
    "name": "control_playback"
  }
}

Input Schema

NameRequiredDescriptionDefault
stateNo
actionYes
device_idNo
track_idsNo
context_uriNo
position_msNo
volume_percentNo

Output Schema

NameRequiredDescriptionDefault
trackNo
deviceNo
repeatNooff
volumeNo
shuffleNo
is_playingYes
progress_msNo
currently_playing_typeNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv0.8.1
    • addedOutput schema / $defs / Track / properties / show
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Show"
      +}
    • addedOutput schema / $defs / Track / properties / show_id
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Show Id"
      +}
    • addedOutput schema / $defs / Track / properties / type
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Type"
      +}
    • addedOutput schema / properties / currently_playing_type
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Currently Playing Type"
      +}
  2. Addedv0.6.1

TDQS

A4/5.0
Behavior4/5

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

Annotations already declare this is a mutating, non-idempotent, open-world but non-destructive call; the description adds real context beyond that — the Premium and active-device preconditions, and that confirmation is best-effort with at most five post-action reads. It also discloses the important limitation that the returned state may be stale or unconfirmed and that not every requested track/context/device transition is verified, which is exactly the kind of caveat annotations cannot express. Only the plain return-type mention is redundant with the existing output schema.

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

Conciseness4/5

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

Purpose and prereqs are front-loaded, then a structured Args/Returns layout with one line per parameter; there is little filler. The Returns paragraph is slightly long given an output schema exists, but the confirmation caveat it carries justifies most of that length.

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

Completeness4/5

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

For a 7-parameter mutation tool with a polymorphic action, the definition covers prerequisites, all parameters, conditional relationships, and verification semantics, and it correctly leans on the output schema for return shape. What is missing is failure behavior — what the caller sees when no active device exists, when Premium is absent, or when a supplied URI is invalid.

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

Parameters5/5

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

Schema description coverage is 0%, so the description carries the entire burden, and it does: it enumerates the legal action values, defines state values per action, explains that track_ids is ignored when context_uri is set, distinguishes bare track IDs from episode URIs/share URLs, and documents the unit and range for position_ms and volume_percent plus the device_id default. This adds meaning well beyond the bare JSON types.

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

Purpose4/5

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

The opening sentence states a specific verb and resource ('Control Spotify playback') and the action list enumerates exactly which playback operations are covered, which implicitly separates it from read-only siblings like get_playback_state and from transfer_playback. It stops short of naming those siblings explicitly, so an agent must infer the boundary rather than read it.

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?

Prerequisites are stated clearly ('Requires Premium and an active device'), and per-action requirements are called out (position_ms for seek, volume_percent for volume), which is genuine when-to-use guidance for the action variants. There is no guidance on when to prefer this over get_playback_state, transfer_playback, or add_to_queue, and no statement of what happens when no device is active.

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