Skip to main content
Glama

remove_tracks

Remove tracks from your Spotify library to maintain a curated collection of current favorites. Clean up outdated music, remove accidental saves, and update your library to reflect changing musical tastes.

Instructions

Remove tracks from the user's personal library to maintain a curated collection of current favorites.

🎯 USE CASES: β€’ Clean up library by removing tracks you no longer enjoy β€’ Maintain relevance in your personal music collection β€’ Remove accidental saves and unwanted additions β€’ Update library to reflect changing musical tastes β€’ Organize library by removing outdated preferences

πŸ“ WHAT IT RETURNS: β€’ Confirmation of successful track removals β€’ Updated library count after removals β€’ List of successfully removed tracks β€’ Error details for tracks that couldn't be removed β€’ Final library state after cleanup operation

πŸ” EXAMPLES: β€’ "Remove 'Old Song' from my liked tracks" β€’ "Unlike these 3 tracks I no longer enjoy" β€’ "Remove track IDs: 1BxfuPKGuaTgP6aM0NMpti, 4LRPiXqCikLlN15c3yImP7" β€’ "Clean up my library by removing outdated music"

🧹 LIBRARY MAINTENANCE: β€’ Keeps collection current and relevant β€’ Reflects evolving musical tastes β€’ Maintains quality over quantity approach β€’ Perfect for regular library cleanup sessions β€’ Essential for curated collection management

πŸ’‘ CURATION TIPS: β€’ Regular cleanup keeps library fresh β€’ Remove tracks that no longer resonate β€’ Consider seasonal relevance for cleanup timing β€’ Use bulk removals for major library overhauls β€’ Keep library aligned with current preferences

⚠️ REQUIREMENTS: β€’ Valid Spotify access token with user-library-modify scope β€’ Track IDs must match exactly for successful removal β€’ Maximum 50 tracks can be removed per request

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tokenYesSpotify access token for authentication
trackIdsYesArray of Spotify track IDs to remove

Implementation Reference

  • The handler function for the 'remove_tracks' tool that extracts arguments and calls SpotifyService.removeTracks
    handler: async (args: any, spotifyService: SpotifyService) => { const { token, trackIds } = args; return await spotifyService.removeTracks(token, trackIds); },
  • Input schema validation for the 'remove_tracks' tool defining token and trackIds parameters
    schema: createSchema({ token: commonSchemas.token(), trackIds: z .array(z.string()) .describe("Array of Spotify track IDs to remove"), }),
  • Registration of all tools by spreading trackTools (containing 'remove_tracks') into the central allTools registry used for MCP tool listing and execution
    export const allTools: ToolsRegistry = { ...albumTools, ...artistTools, ...trackTools, ...playlistTools, ...playbackTools, ...userTools, ...searchTools, };
  • Core helper method in SpotifyService that performs the actual API call to remove tracks from user's library via DELETE /me/tracks
    async removeTracks( token: string, trackIds: string | string[] ): Promise<void> { const ids = Array.isArray(trackIds) ? trackIds.map((id) => this.extractId(id)) : [this.extractId(trackIds)]; const params = { ids: ids.join(",") }; return await this.makeRequest<void>("me/tracks", token, params, "DELETE"); }

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/latiftplgu/Spotify-OAuth-MCP-server'

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