Skip to main content
Glama

Discogs MCP Server

by cswkim
lists.ts1.37 kB
import { isDiscogsError } from '../../errors.js'; import { type UserLists, type UserListsParams, UserListsSchema } from '../../types/user/index.js'; import { BaseUserService } from '../index.js'; /** * Service for Discogs User Lists operations */ export class UserListsService extends BaseUserService { /** * Get a user's lists * @param params - Parameters for the request including username and optional pagination/sorting * @returns {UserLists} A paginated response containing the user's lists * @throws {DiscogsAuthenticationError} If authentication fails * @throws {DiscogsResourceNotFoundError} If the username cannot be found * @throws {Error} If there's a validation error or other unexpected error */ async get({ username, ...options }: UserListsParams): Promise<UserLists> { try { const response = await this.request<UserLists>(`/${username}/lists`, { params: options, }); // Validate the response using Zod schema const validatedResponse = UserListsSchema.parse(response); return validatedResponse; } catch (error) { // If it's already a Discogs error, just rethrow it if (isDiscogsError(error)) { throw error; } // For validation errors or other unexpected errors, wrap them throw new Error(`Failed to get lists: ${String(error)}`); } } }

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/cswkim/discogs-mcp-server'

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