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
| Name | Required | Description | Default |
|---|---|---|---|
| token | Yes | Spotify access token for authentication | |
| trackIds | Yes | Array of Spotify track IDs to remove |
Implementation Reference
- src/mcp/tools/tracks.ts:258-261 (handler)The handler function for the 'remove_tracks' tool that extracts arguments and calls SpotifyService.removeTrackshandler: async (args: any, spotifyService: SpotifyService) => { const { token, trackIds } = args; return await spotifyService.removeTracks(token, trackIds); },
- src/mcp/tools/tracks.ts:252-257 (schema)Input schema validation for the 'remove_tracks' tool defining token and trackIds parametersschema: createSchema({ token: commonSchemas.token(), trackIds: z .array(z.string()) .describe("Array of Spotify track IDs to remove"), }),
- src/mcp/tools/index.ts:22-36 (registration)Registration of all tools by spreading trackTools (containing 'remove_tracks') into the central allTools registry used for MCP tool listing and executionexport const allTools: ToolsRegistry = { ...albumTools, ...artistTools, ...trackTools, ...playlistTools, ...playbackTools, ...userTools, ...searchTools, };
- src/spotify.ts:450-459 (helper)Core helper method in SpotifyService that performs the actual API call to remove tracks from user's library via DELETE /me/tracksasync 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"); }