get_track
Retrieve detailed metadata and audio characteristics for specific Spotify tracks to support music research, application development, and content verification.
Instructions
Retrieve comprehensive information about any specific track including detailed metadata and audio characteristics.
🎯 USE CASES: • Research song details for music blogs or articles • Analyze track metadata for music applications • Get complete song information for sharing or playlisting • Verify track details and availability before use • Build detailed music catalogs and databases
📝 WHAT IT RETURNS: • Complete track information (title, artist, album, duration) • Release date, popularity scores, and market availability • Track artwork, preview URLs, and external links • Explicit content flags and parental guidance information • ISRC codes and other professional identifiers
🔍 EXAMPLES: • "Get details for 'Hotel California' by Eagles" • "Show me information about track ID: 40riOy7x9W7GXjyGp4pjAv" • "I need complete details for this specific song" • "Get metadata for the track I just discovered"
💡 DETAILED INSIGHTS: • Professional music industry identifiers • Cross-platform compatibility information • Regional availability and licensing details • Perfect for music research and analysis • Essential for building music applications
⚠️ REQUIREMENTS: • Valid Spotify access token • Track must exist and be available in user's market
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| token | Yes | Spotify access token for authentication | |
| trackId | Yes | Spotify track ID or URI |
Implementation Reference
- src/mcp/tools/tracks.ts:44-47 (handler)MCP tool handler for 'get_track' which extracts arguments and delegates to SpotifyService.getTrackhandler: async (args: any, spotifyService: SpotifyService) => { const { token, trackId } = args; return await spotifyService.getTrack(token, trackId); },
- src/mcp/tools/tracks.ts:40-43 (schema)Input schema for get_track tool defining token and trackId parametersschema: createSchema({ token: commonSchemas.token(), trackId: commonSchemas.spotifyId("track"), }),
- src/mcp/tools/index.ts:22-36 (registration)Registration of all tools including trackTools (containing get_track) into the central allTools registry used by ToolRegistrarexport const allTools: ToolsRegistry = { ...albumTools, ...artistTools, ...trackTools, ...playlistTools, ...playbackTools, ...userTools, ...searchTools, };
- src/spotify.ts:461-464 (helper)Core helper function SpotifyService.getTrack that fetches track details from Spotify API via makeRequestasync getTrack(token: string, trackId: string): Promise<SpotifyTrack> { const id = this.extractId(trackId); return await this.makeRequest<SpotifyTrack>(`tracks/${id}`, token); }
- src/mcp/server.ts:13-14 (registration)Instantiates ToolRegistrar with SpotifyService, which registers all tools including get_track for the MCP serverconst spotifyService = new SpotifyService(); const toolRegistrar = new ToolRegistrar(spotifyService);