get_track_info
Retrieve Spotify track details including artist, album, and metadata by providing a track ID through the Multi-MCPs server's unified API integration.
Instructions
Get Spotify track details
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| track_id | Yes |
Implementation Reference
- src/apis/spotify/spotify.ts:125-130 (handler)The handler function that implements the core logic of the 'get_track_info' tool. It validates the Spotify configuration and track_id parameter before calling the SpotifyClient's getTrack method to fetch track details.async get_track_info(args: Record<string, unknown>) { if (!cfg.spotifyClientId || !cfg.spotifyClientSecret) throw new Error("SPOTIFY_CLIENT_ID/SECRET are not configured"); const trackId = String(args.track_id || ""); if (!trackId) throw new Error("track_id is required"); return client.getTrack(trackId); },
- src/apis/spotify/spotify.ts:92-96 (schema)The input schema defining the required 'track_id' string parameter for the 'get_track_info' tool.inputSchema: { type: "object", properties: { track_id: { type: "string" } }, required: ["track_id"], },
- src/apis/spotify/spotify.ts:89-97 (registration)The tool registration definition within the Spotify API module, including name, description, and schema.{ name: "get_track_info", description: "Get Spotify track details", inputSchema: { type: "object", properties: { track_id: { type: "string" } }, required: ["track_id"], }, },
- src/tools/register.ts:29-29 (registration)The invocation of registerSpotify() in the central tool registration function, which incorporates the 'get_track_info' tool into the MCP server.registerSpotify(),
- src/apis/spotify/spotify.ts:53-55 (helper)The SpotifyClient helper method that performs the actual API request to retrieve track information by ID.async getTrack(trackId: string) { return this.request(`/tracks/${trackId}`, { headers: await this.authHeaders() }); }