Skip to main content
Glama
cswkim

Discogs MCP Server

by cswkim

get_master_release

Retrieve detailed information about a master release from Discogs by providing its master ID. This tool accesses the Discogs API to fetch comprehensive music catalog data for specific master releases.

Instructions

Get a master release

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
master_idYes

Implementation Reference

  • Definition and handler (execute function) for the 'get_master_release' tool. It instantiates MasterReleaseService and calls its get method.
    export const getMasterReleaseTool: Tool<FastMCPSessionAuth, typeof MasterReleaseIdParamSchema> = {
      name: 'get_master_release',
      description: 'Get a master release',
      parameters: MasterReleaseIdParamSchema,
      execute: async (args) => {
        try {
          const masterReleaseService = new MasterReleaseService();
          const masterRelease = await masterReleaseService.get(args);
    
          return JSON.stringify(masterRelease);
        } catch (error) {
          throw formatDiscogsError(error);
        }
      },
    };
  • Zod input schema for the tool parameters, requiring a 'master_id' integer.
    export const MasterReleaseIdParamSchema = z.object({
      master_id: z.number().int(),
    });
  • Registration of the getMasterReleaseTool with the MCP server.
    server.addTool(getMasterReleaseTool);
  • Core helper function in MasterReleaseService that fetches the master release data from Discogs API and validates it.
    async get({ master_id }: MasterReleaseIdParam): Promise<MasterRelease> {
      try {
        const response = await this.request<MasterRelease>(`/${master_id}`);
    
        const validatedResponse = MasterReleaseSchema.parse(response);
        return validatedResponse;
      } catch (error) {
        if (isDiscogsError(error)) {
          throw error;
        }
    
        throw new Error(`Failed to get master release: ${String(error)}`);
      }
    }

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