get_multiple_artists
Retrieve Spotify catalog details for up to 50 artists simultaneously using their IDs or URIs.
Instructions
Get Spotify catalog information for multiple artists
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"ids": "<ids>"
},
"name": "get_multiple_artists"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ids | Yes | Array of Spotify artist IDs or URIs (max 50) |
Implementation Reference
- src/handlers/artists.ts:23-40 (handler)Executes the tool logic: validates input (1-50 artist IDs), extracts IDs, calls Spotify API /artists?ids=... endpoint.
async getMultipleArtists(args: MultipleArtistsArgs) { if (args.ids.length === 0) { throw new McpError( ErrorCode.InvalidParams, 'At least one artist ID must be provided' ); } if (args.ids.length > 50) { throw new McpError( ErrorCode.InvalidParams, 'Maximum of 50 artist IDs allowed' ); } const artistIds = args.ids.map(this.extractArtistId); return this.api.makeRequest(`/artists?ids=${artistIds.join(',')}`); } - src/types/artists.ts:15-17 (schema)TypeScript interface defining the input arguments: array of artist IDs or URIs.
export interface MultipleArtistsArgs { ids: string[]; } - src/index.ts:155-170 (registration)Registers the tool in ListToolsResponse: name, description, and JSON input schema.
{ name: 'get_multiple_artists', description: 'Get Spotify catalog information for multiple artists', inputSchema: { type: 'object', properties: { ids: { type: 'array', items: { type: 'string' }, description: 'Array of Spotify artist IDs or URIs (max 50)', maxItems: 50 } }, required: ['ids'] }, }, - src/index.ts:718-724 (registration)Handles CallToolRequest: validates args, calls artistsHandler.getMultipleArtists, returns JSON result.
case 'get_multiple_artists': { const args = this.validateArgs<MultipleArtistsArgs>(request.params.arguments, ['ids']); const result = await this.artistsHandler.getMultipleArtists(args); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }], }; } - src/handlers/artists.ts:14-16 (helper)Helper method to normalize artist IDs from Spotify URI to plain ID, used in getMultipleArtists.
private extractArtistId(id: string): string { return id.startsWith('spotify:artist:') ? id.split(':')[2] : id; }