get_marketplace_release_stats
Retrieve marketplace statistics for a Discogs music release to analyze pricing trends and availability across different currencies.
Instructions
Retrieve marketplace statistics for the provided Release ID
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| release_id | Yes | ||
| curr_abbr | No |
Implementation Reference
- src/tools/marketplace.ts:163-178 (handler)The main handler for the 'get_marketplace_release_stats' tool. Defines the tool object with name, description, input schema, and the execute function that creates a MarketplaceService instance and calls getReleaseStats on the provided arguments.export const getMarketplaceReleaseStatsTool: Tool<FastMCPSessionAuth, typeof ReleaseParamsSchema> = { name: 'get_marketplace_release_stats', description: 'Retrieve marketplace statistics for the provided Release ID', parameters: ReleaseParamsSchema, execute: async (args) => { try { const marketplaceService = new MarketplaceService(); const stats = await marketplaceService.getReleaseStats(args); return JSON.stringify(stats); } catch (error) { throw formatDiscogsError(error); } }, };
- src/types/release.ts:154-156 (schema)Input parameters schema for the tool, extending ReleaseIdParamSchema with optional currency code.export const ReleaseParamsSchema = ReleaseIdParamSchema.extend({ curr_abbr: CurrencyCodeSchema.optional(), });
- src/tools/marketplace.ts:251-251 (registration)Registration of the tool in the FastMCP server within the registerMarketplaceTools function.server.addTool(getMarketplaceReleaseStatsTool);
- src/services/marketplace.ts:230-245 (helper)Supporting helper method in MarketplaceService that performs the actual API call to retrieve marketplace stats for a release.async getReleaseStats({ release_id, ...options }: ReleaseParams): Promise<ReleaseStatsResponse> { try { const response = await this.request<ReleaseStatsResponse>(`/stats/${release_id}`, { params: options, }); const validatedResponse = ReleaseStatsResponseSchema.parse(response); return validatedResponse; } catch (error) { if (isDiscogsError(error)) { throw error; } throw new Error(`Failed to get release stats: ${String(error)}`); } }
- src/types/release.ts:147-149 (schema)Base schema for release_id parameter used in ReleaseParamsSchema.export const ReleaseIdParamSchema = z.object({ release_id: z.number().min(1, 'The release_id must be non-zero'), });