Skip to main content
Glama
cswkim

Discogs MCP Server

by cswkim

get_user_wantlist

Retrieve a user's Discogs wantlist to view desired music releases, with options to sort by date, artist, title, or other criteria.

Instructions

Returns the list of releases in a user's wantlist

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
usernameYes
pageNo
per_pageNo
sortNo
sort_orderNo

Implementation Reference

  • The execute handler for the 'get_user_wantlist' MCP tool. Instantiates UserService and delegates to its wants.getList method to fetch and return the user's wantlist as JSON.
    execute: async (args) => { try { const userService = new UserService(); const wantlist = await userService.wants.getList(args); return JSON.stringify(wantlist); } catch (error) { throw formatDiscogsError(error); } },
  • Zod schema defining the input parameters for the get_user_wantlist tool, merging username input with query params for filtering/sorting the wantlist.
    export const UserWantlistParamsSchema = UsernameInputSchema.merge( QueryParamsSchema(['added', 'artist', 'label', 'rating', 'title', 'year'] as const), );
  • Core implementation in UserWantsService.getList: makes authenticated API request to Discogs /${username}/wants endpoint, validates response with Zod, handles errors.
    async getList({ username, ...options }: UserWantlistParams): Promise<UserWantlist> { try { const response = await this.request<UserWantlist>(`/${username}/wants`, { params: options, }); // Validate the response using Zod schema const validatedResponse = UserWantlistSchema.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 wantlist: ${String(error)}`); } }
  • Registration function that adds the get_user_wantlist tool (and related wantlist tools) to the FastMCP server.
    export function registerUserWantlistTools(server: FastMCP): void { server.addTool(getUserWantlistTool); server.addTool(addToWantlistTool); server.addTool(editItemInWantlistTool); server.addTool(deleteItemInWantlistTool); }
  • Invocation of the wantlist tools registration within the central registerTools function.
    registerUserWantlistTools(server);

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

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