Skip to main content
Glama

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
NameRequiredDescriptionDefault
track_idYes

Implementation Reference

  • 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); },
  • 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"], },
  • 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"], }, },
  • The invocation of registerSpotify() in the central tool registration function, which incorporates the 'get_track_info' tool into the MCP server.
    registerSpotify(),
  • 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() }); }

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