Skip to main content
Glama

get_track_info

Retrieve detailed Spotify track information by providing a track ID. The tool integrates with the Multi-MCPs server to streamline access to Spotify data and other third-party APIs.

Instructions

Get Spotify track details

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
track_idYes

Implementation Reference

  • The main handler function for the 'get_track_info' tool. It validates the Spotify configuration, extracts and validates the track_id from input arguments, and calls the SpotifyClient's getTrack method to retrieve the track information.
    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); },
  • The tool registration object within the registerSpotify function's tools array, defining the name, description, and input schema for 'get_track_info'.
    { name: "get_track_info", description: "Get Spotify track details", inputSchema: { type: "object", properties: { track_id: { type: "string" } }, required: ["track_id"], }, },
  • Input schema definition for the 'get_track_info' tool, specifying that it requires a 'track_id' string.
    inputSchema: { type: "object", properties: { track_id: { type: "string" } }, required: ["track_id"], },
  • Helper method in SpotifyClient class that performs the actual API request to retrieve track details using the provided trackId.
    async getTrack(trackId: string) { return this.request(`/tracks/${trackId}`, { headers: await this.authHeaders() }); }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/TaylorChen/muti-mcps'

If you have feedback or need assistance with the MCP directory API, please join our Discord server