get_user_collection_items
Retrieve and manage items from a user's Discogs collection by specifying the username, folder ID, and sorting preferences. Use this tool to organize and access music catalog data efficiently.
Instructions
Retrieve a list of items in a user's collection
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| folder_id | Yes | ||
| page | No | ||
| per_page | No | ||
| sort | No | ||
| sort_order | No | ||
| username | Yes |
Implementation Reference
- src/tools/userCollection.ts:238-255 (handler)MCP tool object defining the 'get_user_collection_items' handler, including name, description, parameters schema, and execute function that calls UserService.collection.getItems to fetch the collection items.export const getUserCollectionItemsTool: Tool< FastMCPSessionAuth, typeof UserCollectionItemsParamsSchema > = { name: 'get_user_collection_items', description: `Retrieve a list of items in a user's collection`, parameters: UserCollectionItemsParamsSchema, execute: async (args) => { try { const userService = new UserService(); const items = await userService.collection.getItems(args); return JSON.stringify(items); } catch (error) { throw formatDiscogsError(error); } }, };
- src/types/user/collection.ts:88-101 (schema)Zod schema defining the input parameters for the tool: merges username, optional folder_id, and query parameters for filtering collection items.export const UserCollectionItemsParamsSchema = UsernameInputSchema.merge( FolderIdParamSchema().merge( QueryParamsSchema([ 'added', 'artist', 'catno', 'format', 'label', 'rating', 'title', 'year', ] as const), ), );
- src/tools/userCollection.ts:327-327 (registration)Registration of the getUserCollectionItemsTool with the FastMCP server instance.server.addTool(getUserCollectionItemsTool);
- src/tools/index.ts:20-20 (registration)Invocation of registerUserCollectionTools which includes adding the get_user_collection_items tool to the server.registerUserCollectionTools(server);