Skip to main content
Glama

Discogs MCP Server

by cswkim
list.ts1.28 kB
import { isDiscogsError } from '../errors.js'; import { ListSchema, type List, type ListIdParam } from '../types/list.js'; import { DiscogsService } from './index.js'; /** * Service for Discogs List-related operations */ export class ListService extends DiscogsService { constructor() { super('/lists'); } /** * Returns items from a specified List * * @param params - Parameters containing the list ID * @returns {List} The list information * @throws {DiscogsPermissionError} If the user doesn't have permission to access the list * @throws {DiscogsResourceNotFoundError} If the list cannot be found * @throws {Error} If there's a validation error or other unexpected error */ async getList({ list_id }: ListIdParam): Promise<List> { try { const response = await this.request<List>(`/${list_id}`); // Validate the response using Zod schema const validatedResponse = ListSchema.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 list: ${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