Skip to main content
Glama

MCP Spotify Server

search.ts650 B
import { SpotifyApi } from '../utils/api.js'; import { SearchArgs } from '../types/search.js'; import { McpError, ErrorCode } from '@modelcontextprotocol/sdk/types.js'; export class SearchHandler { constructor(private api: SpotifyApi) {} async search(args: SearchArgs) { const { query, type, limit = 20 } = args; if (limit < 1 || limit > 50) { throw new McpError( ErrorCode.InvalidParams, 'Limit must be between 1 and 50' ); } const params = { q: encodeURIComponent(query), type, limit }; return this.api.makeRequest(`/search${this.api.buildQueryString(params)}`); } }

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/superseoworld/mcp-spotify'

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