get_album
Retrieve Spotify album details including tracks, artists, and release information using the album's Spotify ID or URI.
Instructions
Get Spotify catalog information for an album
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | The Spotify ID or URI for the album |
Implementation Reference
- src/handlers/albums.ts:17-20 (handler)The main handler function that implements the get_album tool logic by extracting the album ID and making an API request to Spotify's /albums/{id} endpoint.async getAlbum(args: AlbumArgs) { const albumId = this.extractAlbumId(args.id); return this.api.makeRequest(`/albums/${albumId}`); }
- src/index.ts:239-250 (registration)Tool registration in the ListTools handler, defining the name, description, and input schema for 'get_album'.name: 'get_album', description: 'Get Spotify catalog information for an album', inputSchema: { type: 'object', properties: { id: { type: 'string', description: 'The Spotify ID or URI for the album' } }, required: ['id'] },
- src/index.ts:750-756 (registration)Dispatch logic in the CallToolRequest handler that validates arguments and calls the getAlbum handler.case 'get_album': { const args = this.validateArgs<AlbumArgs>(request.params.arguments, ['id']); const result = await this.albumsHandler.getAlbum(args); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }], }; }
- src/types/albums.ts:3-5 (schema)TypeScript interface defining the input shape for AlbumArgs used in the handler.export interface AlbumArgs { id: string; }
- src/handlers/albums.ts:13-15 (helper)Helper method to normalize Spotify album ID from URI or plain ID.private extractAlbumId(id: string): string { return id.startsWith('spotify:album:') ? id.split(':')[2] : id; }