remove_listing
Delete a marketplace listing by its ID. Requires seller authorization to remove their own listings from the W3Ship marketplace.
Instructions
Remove a marketplace listing. Only the seller can remove their own listing.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| listingId | Yes | The listing ID to remove | |
| sellerAddress | No | Seller wallet address (must match listing). Uses W3SHIP_PUBLIC_KEY if not provided. |
Implementation Reference
- src/index.ts:1119-1139 (handler)Handler implementation for the 'remove_listing' tool which communicates with the W3Ship API to delete a marketplace listing.
case 'remove_listing': { const { listingId: removeId, sellerAddress: removeSeller } = args as any; const rmSeller = removeSeller || CONFIGURED_KEY; try { const params = new URLSearchParams({ id: removeId }); if (rmSeller) params.set('seller', rmSeller); const delRes = await fetch(`${W3SHIP_API}/api/listing?${params.toString()}`, { method: 'DELETE' }); const delData = await delRes.json() as any; if (!delRes.ok) { return { content: [{ type: 'text', text: `Error: ${delData.error || 'Failed to remove listing'}` }], isError: true }; } return { content: [{ type: 'text', text: JSON.stringify({ removed: removeId, message: delData.message || 'Listing removed.' }, null, 2) }] }; } catch (e: any) { return { content: [{ type: 'text', text: `Error removing listing: ${e.message}` }], isError: true }; } } - src/index.ts:315-325 (schema)MCP tool registration and input schema definition for 'remove_listing'.
name: 'remove_listing', description: 'Remove a marketplace listing. Only the seller can remove their own listing.', inputSchema: { type: 'object', properties: { listingId: { type: 'string', description: 'The listing ID to remove' }, sellerAddress: { type: 'string', description: 'Seller wallet address (must match listing). Uses W3SHIP_PUBLIC_KEY if not provided.' }, }, required: ['listingId'], }, },