Skip to main content
Glama
cswkim

Discogs MCP Server

by cswkim

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
NameRequiredDescriptionDefault
destination_folder_idYes
folder_idYes
instance_idYes
release_idYes
usernameYes

Implementation Reference

  • 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); } }, };
  • 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)}`); } }
  • 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); }
  • 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(); } }

Other Tools

Related Tools

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