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
| Name | Required | Description | Default |
|---|---|---|---|
| username | Yes | ||
| page | No | ||
| per_page | No | ||
| sort | No | ||
| sort_order | No |
Implementation Reference
- src/tools/userWantlist.ts:14-23 (handler)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); } },
- src/types/user/wants.ts:8-10 (schema)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), );
- src/services/user/wants.ts:26-44 (helper)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)}`); } }
- src/tools/userWantlist.ts:87-92 (registration)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); }
- src/tools/index.ts:21-21 (registration)Invocation of the wantlist tools registration within the central registerTools function.registerUserWantlistTools(server);