get_listing
Retrieve complete marketplace listing details using a specific ID to access product information and specifications.
Instructions
Get full details of a specific marketplace listing by ID.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| listingId | Yes | The listing ID |
Implementation Reference
- src/index.ts:1086-1117 (handler)The `get_listing` tool handler in `src/index.ts` fetches marketplace listing details from the `W3SHIP_API`.
case 'get_listing': { const { listingId } = args as any; try { const getRes = await fetch(`${W3SHIP_API}/api/listing?id=${encodeURIComponent(listingId)}`); const getData = await getRes.json() as any; if (!getRes.ok || !getData.listing) { return { content: [{ type: 'text', text: `Listing "${listingId}" not found.` }], isError: true }; } const listing = getData.listing; return { content: [{ type: 'text', text: JSON.stringify({ listing: { id: listing.id, title: listing.title, description: listing.description, price: `${listing.price} ${listing.currency}`, category: listing.category, condition: listing.condition, seller: listing.sellerName || listing.sellerAddress, paymentAddress: listing.sellerAddress, quantity: listing.quantity, shipsTo: listing.shipsTo, status: listing.status, createdAt: listing.createdAt, expiresAt: listing.expiresAt, }, actions: { addToCart: `Use add_item with productOffering.id = "${listing.id}" and productOffering.name = "${listing.title}"`, payWith: `Send ${listing.price} ${listing.currency} to ${listing.sellerAddress}`, }, }, null, 2) }] }; } catch (e: any) { return { content: [{ type: 'text', text: `Error getting listing: ${e.message}` }], isError: true }; } }