update_marketplace_listing
Modify existing marketplace listings on Discogs by updating details like condition, price, and status to maintain accurate inventory.
Instructions
Update a marketplace listing
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| listing_id | Yes | ||
| release_id | Yes | ||
| condition | Yes | ||
| sleeve_condition | No | ||
| price | Yes | ||
| comments | No | ||
| allow_offers | No | ||
| status | Yes | ||
| external_id | No | ||
| location | No | ||
| weight | No | ||
| format_quantity | No |
Implementation Reference
- src/tools/marketplace.ts:221-238 (handler)The tool handler (execute function) for 'update_marketplace_listing'. It instantiates MarketplaceService and calls its updateListing method with the input args.export const updateMarketplaceListingTool: Tool< FastMCPSessionAuth, typeof ListingUpdateParamsSchema > = { name: 'update_marketplace_listing', description: 'Update a marketplace listing', parameters: ListingUpdateParamsSchema, execute: async (args) => { try { const marketplaceService = new MarketplaceService(); await marketplaceService.updateListing(args); return 'Listing updated successfully'; } catch (error) { throw formatDiscogsError(error); } }, };
- src/types/marketplace.ts:190-190 (schema)Zod schema definition for input parameters of the update_marketplace_listing tool, merging ListingIdParamSchema and ListingNewParamsSchema.export const ListingUpdateParamsSchema = ListingIdParamSchema.merge(ListingNewParamsSchema);
- src/tools/marketplace.ts:240-252 (registration)Registration function that adds the updateMarketplaceListingTool (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:282-295 (helper)The supporting method in MarketplaceService that performs the actual Discogs API POST request to update the listing.async updateListing({ listing_id, ...body }: ListingUpdateParams): Promise<void> { try { await this.request<void>(`/listings/${listing_id}`, { method: 'POST', body, }); } catch (error) { if (isDiscogsError(error)) { throw error; } throw new Error(`Failed to update listing: ${String(error)}`); } }