search_tracks
Find music tracks on Spotify by entering search terms. This tool helps users discover songs, artists, or albums through the Multi-MCPs server's integrated services.
Instructions
Search tracks on Spotify
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | ||
| limit | No |
Implementation Reference
- src/apis/spotify/spotify.ts:118-124 (handler)The handler function for the 'search_tracks' MCP tool. It validates the input arguments, checks configuration, and calls the SpotifyClient's searchTracks method to perform the search.async search_tracks(args: Record<string, unknown>) { if (!cfg.spotifyClientId || !cfg.spotifyClientSecret) throw new Error("SPOTIFY_CLIENT_ID/SECRET are not configured"); const query = String(args.query || ""); if (!query) throw new Error("query is required"); const limit = args.limit ? Number(args.limit) : undefined; return client.searchTracks(query, limit); },
- src/apis/spotify/spotify.ts:80-88 (registration)Registration of the 'search_tracks' tool in the tools array of the ToolRegistration object returned by registerSpotify().{ name: "search_tracks", description: "Search tracks on Spotify", inputSchema: { type: "object", properties: { query: { type: "string" }, limit: { type: "number" } }, required: ["query"], }, },
- src/apis/spotify/spotify.ts:83-86 (schema)Input schema defining the expected parameters for the 'search_tracks' tool: query (required string) and optional limit (number).inputSchema: { type: "object", properties: { query: { type: "string" }, limit: { type: "number" } }, required: ["query"],
- src/apis/spotify/spotify.ts:46-51 (helper)Helper method on SpotifyClient class that makes the actual Spotify API request to search for tracks.async searchTracks(query: string, limit?: number) { return this.request("/search", { headers: await this.authHeaders(), query: { q: query, type: "track", limit: limit ?? 10 }, }); }