Skip to main content
Glama
superseoworld

MCP Spotify Server

remove_tracks_from_playlist

Delete specific tracks from a Spotify playlist using track URIs to manage and update your music collection.

Instructions

Remove one or more tracks from a playlist

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesThe Spotify ID or URI of the playlist
tracksYesArray of objects containing Spotify track URIs to remove
snapshot_idNoOptional. The playlist's snapshot ID

Implementation Reference

  • The core handler function in PlaylistsHandler class that implements the logic to remove tracks from a Spotify playlist. It extracts the playlist ID, prepares the request data, and makes a DELETE request to the Spotify API endpoint `/playlists/{playlistId}/tracks`.
    async removeTracksFromPlaylist(args: RemoveTracksFromPlaylistArgs) {
      const playlistId = this.extractPlaylistId(args.id);
      const { tracks, snapshot_id } = args;
    
      const data = {
        tracks,
        ...(snapshot_id !== undefined && { snapshot_id })
      };
    
      return this.api.makeRequest(
        `/playlists/${playlistId}/tracks`,
        'DELETE',
        data
      );
    }
  • src/index.ts:582-619 (registration)
    The tool registration in the listTools response, defining the name, description, and inputSchema for 'remove_tracks_from_playlist'.
      name: 'remove_tracks_from_playlist',
      description: 'Remove one or more tracks from a playlist',
      inputSchema: {
        type: 'object',
        properties: {
          id: {
            type: 'string',
            description: 'The Spotify ID or URI of the playlist'
          },
          tracks: {
            type: 'array',
            items: {
              type: 'object',
              properties: {
                uri: {
                  type: 'string',
                  description: 'Spotify URI of the track to remove'
                },
                positions: {
                  type: 'array',
                  items: {
                    type: 'number'
                  },
                  description: 'Optional positions of the track to remove'
                }
              },
              required: ['uri']
            },
            description: 'Array of objects containing Spotify track URIs to remove'
          },
          snapshot_id: {
            type: 'string',
            description: 'Optional. The playlist\'s snapshot ID'
          }
        },
        required: ['id', 'tracks']
      },
    },
  • TypeScript interface defining the input arguments for the removeTracksFromPlaylist tool, used for validation.
    export interface RemoveTracksFromPlaylistArgs {
      id: string;
      tracks: Array<{
        uri: string;
        positions?: number[];
      }>;
      snapshot_id?: string;
    }
  • src/index.ts:869-875 (registration)
    The dispatch case in the main CallToolRequest handler that validates arguments and delegates to the playlistsHandler.removeTracksFromPlaylist method.
    case 'remove_tracks_from_playlist': {
      const args = this.validateArgs<RemoveTracksFromPlaylistArgs>(request.params.arguments, ['id', 'tracks']);
      const result = await this.playlistsHandler.removeTracksFromPlaylist(args);
      return {
        content: [{ type: 'text', text: JSON.stringify(result, null, 2) }],
      };
    }
Behavior2/5

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

No annotations are provided, so the description carries full burden. It states the tool performs a removal operation but doesn't disclose behavioral traits like whether this is destructive (it likely is), what permissions are required, if changes are reversible, rate limits, or what happens to the playlist structure after removal. The description is minimal and lacks essential context for a mutation tool.

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, efficient sentence with zero waste. It's front-loaded with the core action and resource, making it easy to parse quickly. Every word earns its place without redundancy.

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?

For a mutation tool with no annotations and no output schema, the description is incomplete. It doesn't address what the tool returns, error conditions, or important behavioral aspects like idempotency or side effects. Given the complexity of removing tracks from a playlist, more context is needed for safe and effective use.

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

Parameters3/5

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

Schema description coverage is 100%, so the schema already documents all parameters thoroughly. The description adds no additional meaning beyond what's in the schema—it doesn't explain parameter interactions, format examples, or edge cases. Baseline 3 is appropriate when the schema does the heavy lifting.

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 description clearly states the action ('Remove') and resource ('tracks from a playlist'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'modify_playlist' which might also handle track removal, nor does it specify if this is a batch operation versus single-track removal.

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

Usage Guidelines2/5

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

No guidance is provided on when to use this tool versus alternatives. With siblings like 'modify_playlist' that might overlap in functionality, the description offers no context about prerequisites, permissions needed, or when this specific tool is preferred over others for track removal.

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

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