Skip to main content
Glama
baskcart

W3Ship MCP Server

by baskcart

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
NameRequiredDescriptionDefault
listingIdYesThe listing ID

Implementation Reference

  • 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 };
        }
    }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/baskcart/w3ship-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server