Skip to main content
Glama
cswkim

Discogs MCP Server

by cswkim

add_release_to_user_collection_folder

Add a specific music release to a designated folder in a user's Discogs collection by providing the username, folder ID, and release ID. Streamlines catalog organization for music enthusiasts.

Instructions

Add a release to a folder in a user's collection. The folder_id must be non-zero.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
folder_idYes
release_idYes
usernameYes

Implementation Reference

  • FastMCP tool definition: name, description, input schema reference, and execute handler that creates UserService instance and calls its collection.addReleaseToFolder method to perform the operation.
    export const addReleaseToUserCollectionFolderTool: Tool< FastMCPSessionAuth, typeof UserCollectionFolderReleaseParamsSchema > = { name: 'add_release_to_user_collection_folder', description: `Add a release to a folder in a user's collection. The folder_id must be non-zero.`, parameters: UserCollectionFolderReleaseParamsSchema, execute: async (args) => { try { const userService = new UserService(); const release = await userService.collection.addReleaseToFolder(args); return JSON.stringify(release); } catch (error) { throw formatDiscogsError(error); } }, };
  • Zod schema for tool parameters: merges UsernameInputSchema, FolderIdParamSchema (min 1), and ReleaseIdParamSchema.
    export const UserCollectionFolderReleaseParamsSchema = UsernameInputSchema.merge( FolderIdParamSchema(1).merge(ReleaseIdParamSchema), );
  • Registration of the tool object with the FastMCP server inside registerUserCollectionTools function.
    server.addTool(addReleaseToUserCollectionFolderTool);
  • Core implementation in UserCollectionService: makes authenticated POST request to Discogs API endpoint /${username}/collection/folders/${folder_id}/releases/${release_id}, validates response with Zod.
    async addReleaseToFolder({ username, folder_id, release_id, }: UserCollectionFolderReleaseParams): Promise<UserCollectionReleaseAdded> { try { const response = await this.request<UserCollectionReleaseAdded>( `/${username}/collection/folders/${folder_id}/releases/${release_id}`, { method: 'POST', }, ); const validatedResponse = UserCollectionReleaseAddedSchema.parse(response); return validatedResponse; } catch (error) { if (isDiscogsError(error)) { throw error; } throw new Error(`Failed to add release to folder: ${String(error)}`); } }

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