create_marketplace_listing
Create a new marketplace listing on Discogs by specifying release ID, condition, price, and status. Manage music catalog entries with ease using predefined parameters for streamlined selling.
Instructions
Create a new marketplace listing
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| allow_offers | No | ||
| comments | No | ||
| condition | Yes | ||
| external_id | No | ||
| format_quantity | No | ||
| location | No | ||
| price | Yes | ||
| release_id | Yes | ||
| sleeve_condition | No | ||
| status | Yes | ||
| weight | No |
Implementation Reference
- src/tools/marketplace.ts:23-38 (handler)The main handler for the 'create_marketplace_listing' tool. It instantiates MarketplaceService and calls createListing with the input args, returning the JSON stringified response.export const createMarketplaceListingTool: Tool<FastMCPSessionAuth, typeof ListingNewParamsSchema> = { name: 'create_marketplace_listing', description: 'Create a new marketplace listing', parameters: ListingNewParamsSchema, execute: async (args) => { try { const marketplaceService = new MarketplaceService(); const listing = await marketplaceService.createListing(args); return JSON.stringify(listing); } catch (error) { throw formatDiscogsError(error); } }, };
- src/types/marketplace.ts:171-183 (schema)Zod schema defining the input parameters for the create_marketplace_listing tool.export const ListingNewParamsSchema = z.object({ release_id: z.number().int(), condition: ConditionSchema, sleeve_condition: SleeveConditionSchema.optional(), price: z.number(), comments: z.string().optional(), allow_offers: z.boolean().optional(), status: SaleStatusSchema, external_id: z.string().optional(), location: z.string().optional(), weight: z.number().optional(), format_quantity: z.number().optional(), });
- src/tools/marketplace.ts:240-252 (registration)Registers the createMarketplaceListingTool (and other marketplace tools) 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:44-60 (helper)The MarketplaceService method that handles the actual API call to create a listing via POST /marketplace/listings.async createListing(params: ListingNewParams): Promise<ListingNewResponse> { try { const response = await this.request<ListingNewResponse>(`/listings`, { method: 'POST', body: params, }); const validatedResponse = ListingNewResponseSchema.parse(response); return validatedResponse; } catch (error) { if (isDiscogsError(error)) { throw error; } throw new Error(`Failed to create listing: ${String(error)}`); } }