get_marketplace_listing
Retrieve detailed marketplace listings from Discogs by providing a listing ID, with optional currency selection for pricing information.
Instructions
Get a listing from the marketplace
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| listing_id | Yes | ||
| curr_abbr | No |
Implementation Reference
- src/tools/marketplace.ts:84-98 (handler)MCP tool definition and handler (execute function) for 'get_marketplace_listing', which calls MarketplaceService.getListing(args) and returns JSON string.export const getMarketplaceListingTool: Tool<FastMCPSessionAuth, typeof ListingGetParamsSchema> = { name: 'get_marketplace_listing', description: 'Get a listing from the marketplace', parameters: ListingGetParamsSchema, execute: async (args) => { try { const marketplaceService = new MarketplaceService(); const listing = await marketplaceService.getListing(args); return JSON.stringify(listing); } catch (error) { throw formatDiscogsError(error); } }, };
- src/types/marketplace.ts:160-169 (schema)Input schema (parameters) for the get_marketplace_listing tool: ListingGetParamsSchema extending ListingIdParamSchema with optional currency.export const ListingIdParamSchema = z.object({ listing_id: z.number().int(), }); /** * The listing get parameters schema */ export const ListingGetParamsSchema = ListingIdParamSchema.extend({ curr_abbr: CurrencyCodeSchema.optional(), });
- src/tools/marketplace.ts:240-252 (registration)Registration function that adds the getMarketplaceListingTool (among others) to the FastMCP server.export function registerMarketplaceTools(server: FastMCP): void { server.addTool(getUserInventoryTool); server.addTool(getMarketplaceListingTool); server.addTool(createMarketplaceListingTool); server.addTool(updateMarketplaceListingTool); server.addTool(deleteMarketplaceListingTool); server.addTool(getMarketplaceOrderTool); server.addTool(editMarketplaceOrderTool); server.addTool(getMarketplaceOrdersTool); server.addTool(getMarketplaceOrderMessagesTool); server.addTool(createMarketplaceOrderMessageTool); server.addTool(getMarketplaceReleaseStatsTool); }
- src/services/marketplace.ts:124-139 (helper)MarketplaceService.getListing method: performs the actual Discogs API request to fetch the listing and validates with ListingSchema.async getListing({ listing_id, ...options }: ListingGetParams): Promise<Listing> { try { const response = await this.request<Listing>(`/listings/${listing_id}`, { params: options, }); const validatedResponse = ListingSchema.parse(response); return validatedResponse; } catch (error) { if (isDiscogsError(error)) { throw error; } throw new Error(`Failed to get listing: ${String(error)}`); } }