get_artist
Retrieve detailed Spotify catalog information for an artist using their Spotify ID or URI to access artist profiles, discographies, and related data.
Instructions
Get Spotify catalog information for an artist
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | The Spotify ID or URI for the artist |
Implementation Reference
- src/handlers/artists.ts:18-21 (handler)The core implementation of the 'get_artist' tool. Extracts the Spotify artist ID from the input and makes an API request to retrieve the artist's catalog information.async getArtist(args: ArtistArgs) { const artistId = this.extractArtistId(args.id); return this.api.makeRequest(`/artists/${artistId}`); }
- src/types/artists.ts:3-5 (schema)TypeScript interface defining the input arguments for the get_artist tool, consisting of the required 'id' field.export interface ArtistArgs { id: string; }
- src/index.ts:141-154 (registration)Registration of the 'get_artist' tool in the ListTools response, providing name, description, and input schema specification.{ name: 'get_artist', description: 'Get Spotify catalog information for an artist', inputSchema: { type: 'object', properties: { id: { type: 'string', description: 'The Spotify ID or URI for the artist' } }, required: ['id'] }, },
- src/index.ts:710-716 (registration)Dispatch logic in the CallToolRequest handler that validates arguments and delegates to the ArtistsHandler.getArtist method.case 'get_artist': { const args = this.validateArgs<ArtistArgs>(request.params.arguments, ['id']); const result = await this.artistsHandler.getArtist(args); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }], }; }
- src/handlers/artists.ts:14-16 (helper)Helper method used by getArtist to normalize Spotify artist IDs or URIs to plain IDs.private extractArtistId(id: string): string { return id.startsWith('spotify:artist:') ? id.split(':')[2] : id; }