Skip to main content
Glama
cswkim

Discogs MCP Server

by cswkim

find_release_in_user_collection

Locate a specific release within a user's Discogs collection by providing the username, release ID, and optional pagination or sorting parameters. Integrates with the Discogs API for catalog management.

Instructions

Find a release in a user's collection

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pageNo
per_pageNo
release_idYes
sortNo
sort_orderNo
usernameYes

Implementation Reference

  • The MCP tool handler for 'find_release_in_user_collection', which instantiates UserService and calls collection.findRelease(args) to retrieve matching releases from the user's Discogs collection.
    export const findReleaseInUserCollectionTool: Tool< FastMCPSessionAuth, typeof UserCollectionReleaseParamsSchema > = { name: 'find_release_in_user_collection', description: `Find a release in a user's collection`, parameters: UserCollectionReleaseParamsSchema, execute: async (args) => { try { const userService = new UserService(); const releases = await userService.collection.findRelease(args); return JSON.stringify(releases); } catch (error) { throw formatDiscogsError(error); } }, };
  • Zod schema defining the input parameters for finding a release in a user's collection, merging username, release_id, and query params.
    export const UserCollectionReleaseParamsSchema = UsernameInputSchema.merge( ReleaseIdParamSchema.merge(QueryParamsSchema()), );
  • Registration of the tool with the FastMCP server instance.
    server.addTool(findReleaseInUserCollectionTool);
  • The UserCollectionService.findRelease method that makes the Discogs API request to fetch releases matching the release_id in the user's collection, with validation and error handling.
    async findRelease({ username, release_id, ...options }: UserCollectionReleaseParams): Promise<UserCollectionItemsByRelease> { try { const response = await this.request<UserCollectionItemsByRelease>( `/${username}/collection/releases/${release_id}`, { params: options, }, ); // Validate the response using Zod schema const validatedResponse = UserCollectionItemsByReleaseSchema.parse(response); return validatedResponse; } catch (error) { if (isDiscogsError(error)) { throw error; } // For unexpected errors, wrap them throw new Error(`Failed to find release in collection: ${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