Skip to main content
Glama

get_multiple_albums

Retrieve Spotify catalog details for multiple albums using their IDs, enabling batch access to album information for up to 20 albums at once.

Instructions

Get Spotify catalog information for multiple albums

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idsYesArray of Spotify album IDs or URIs (max 20)

Implementation Reference

  • The main handler function that fetches multiple albums from Spotify API after validation and ID extraction.
    async getMultipleAlbums(args: MultipleAlbumsArgs) { if (args.ids.length === 0) { throw new McpError( ErrorCode.InvalidParams, 'At least one album ID must be provided' ); } if (args.ids.length > 20) { throw new McpError( ErrorCode.InvalidParams, 'Maximum of 20 album IDs allowed' ); } const albumIds = args.ids.map(this.extractAlbumId); return this.api.makeRequest(`/albums?ids=${albumIds.join(',')}`); }
  • TypeScript interface defining the input arguments for getMultipleAlbums.
    export interface MultipleAlbumsArgs { ids: string[]; }
  • src/index.ts:280-294 (registration)
    Tool registration in the listTools response, including name, description, and input schema.
    name: 'get_multiple_albums', description: 'Get Spotify catalog information for multiple albums', inputSchema: { type: 'object', properties: { ids: { type: 'array', items: { type: 'string' }, description: 'Array of Spotify album IDs or URIs (max 20)', maxItems: 20 } }, required: ['ids'] }, },
  • src/index.ts:766-772 (registration)
    Dispatch logic in callTool handler that invokes the albums handler.
    case 'get_multiple_albums': { const args = this.validateArgs<MultipleAlbumsArgs>(request.params.arguments, ['ids']); const result = await this.albumsHandler.getMultipleAlbums(args); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }], }; }

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