move_release_in_user_collection
Move a music release from one folder to another in a user's Discogs collection by specifying the username, folder IDs, and release ID.
Instructions
Move a release in a user's collection to another folder
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| destination_folder_id | Yes | ||
| folder_id | Yes | ||
| instance_id | Yes | ||
| release_id | Yes | ||
| username | Yes |
Implementation Reference
- src/tools/userCollection.ts:279-296 (handler)MCP tool object defining the 'move_release_in_user_collection' tool, including its handler (execute function) that instantiates UserService and delegates to its collection.moveRelease method.export const moveReleaseInUserCollectionTool: Tool< FastMCPSessionAuth, typeof UserCollectionMoveReleaseParamsSchema > = { name: 'move_release_in_user_collection', description: `Move a release in a user's collection to another folder`, parameters: UserCollectionMoveReleaseParamsSchema, execute: async (args) => { try { const userService = new UserService(); await userService.collection.moveRelease(args); return 'Release moved successfully'; } catch (error) { throw formatDiscogsError(error); } }, };
- src/types/user/collection.ts:157-160 (schema)Zod schema for the input parameters of the move release tool, extending the release deleted params with destination_folder_id.export const UserCollectionMoveReleaseParamsSchema = UserCollectionReleaseDeletedParamsSchema.extend({ destination_folder_id: z.number(), });
- Core implementation in UserCollectionService: sends POST request to Discogs API endpoint to move the release instance to the specified destination folder.async moveRelease({ username, folder_id, release_id, instance_id, ...body }: UserCollectionMoveReleaseParams): Promise<void> { try { await this.request<void>( `/${username}/collection/folders/${folder_id}/releases/${release_id}/instances/${instance_id}`, { method: 'POST', body: { folder_id: body.destination_folder_id }, }, ); } catch (error) { if (isDiscogsError(error)) { throw error; } throw new Error(`Failed to move release: ${String(error)}`); } }
- src/tools/userCollection.ts:320-335 (registration)Function to register all user collection tools to the FastMCP server, including server.addTool(moveReleaseInUserCollectionTool).export function registerUserCollectionTools(server: FastMCP): void { server.addTool(getUserCollectionFoldersTool); server.addTool(createUserCollectionFolderTool); server.addTool(getUserCollectionFolderTool); server.addTool(editUserCollectionFolderTool); server.addTool(deleteUserCollectionFolderTool); server.addTool(findReleaseInUserCollectionTool); server.addTool(getUserCollectionItemsTool); server.addTool(addReleaseToUserCollectionFolderTool); server.addTool(rateReleaseInUserCollectionTool); server.addTool(moveReleaseInUserCollectionTool); server.addTool(deleteReleaseFromUserCollectionFolderTool); server.addTool(getUserCollectionCustomFieldsTool); server.addTool(editUserCollectionCustomFieldValueTool); server.addTool(getUserCollectionValueTool); }
- src/services/user/index.ts:9-21 (helper)UserService class that provides the 'collection' property instantiating UserCollectionService, used by the tool handler.export class UserService { public collection: UserCollectionService; public lists: UserListsService; public profile: UserProfileService; public wants: UserWantsService; constructor() { this.collection = new UserCollectionService(); this.lists = new UserListsService(); this.profile = new UserProfileService(); this.wants = new UserWantsService(); } }