Skip to main content
Glama
superseoworld

MCP Spotify Server

get_current_user_playlists

Retrieve a list of playlists owned or followed by the current Spotify user, with options to limit results and offset starting position for pagination.

Instructions

Get a list of the playlists owned or followed by the current Spotify user

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum number of playlists to return (1-50)
offsetNoThe index of the first playlist to return

Implementation Reference

  • The core handler function that implements the tool logic by making a Spotify API request to /me/playlists with pagination parameters.
    async getCurrentUserPlaylists(args: GetCurrentUserPlaylistsArgs) {
      const { limit, offset } = args;
    
      const params = {
        ...(limit !== undefined && { limit }),
        ...(offset !== undefined && { offset })
      };
    
      return this.api.makeRequest(
        `/me/playlists${this.api.buildQueryString(params)}`
      );
    }
  • TypeScript interface defining the input arguments for the get_current_user_playlists tool, extending PaginationParams.
    export interface GetCurrentUserPlaylistsArgs extends PaginationParams {
      limit?: number;
      offset?: number;
    }
  • src/index.ts:877-883 (registration)
    Dispatch handler in the main switch statement that routes the tool call to the playlistsHandler.getCurrentUserPlaylists method.
    case 'get_current_user_playlists': {
      const args = this.validateArgs<GetCurrentUserPlaylistsArgs>(request.params.arguments || {}, []);
      const result = await this.playlistsHandler.getCurrentUserPlaylists(args);
      return {
        content: [{ type: 'text', text: JSON.stringify(result, null, 2) }],
      };
    }
  • src/index.ts:620-639 (registration)
    Tool registration in the ListTools response, defining the name, description, and input schema for the tool.
    {
      name: 'get_current_user_playlists',
      description: 'Get a list of the playlists owned or followed by the current Spotify user',
      inputSchema: {
        type: 'object',
        properties: {
          limit: {
            type: 'number',
            description: 'Maximum number of playlists to return (1-50)',
            minimum: 1,
            maximum: 50
          },
          offset: {
            type: 'number',
            description: 'The index of the first playlist to return',
            minimum: 0
          }
        }
      },
    },

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