Skip to main content
Glama
baskcart

W3Ship MCP Server

by baskcart

add_tracking

Add shipping tracking information to an order by providing the carrier and tracking number, enabling buyers to monitor their shipment status.

Instructions

Seller tool: Add real shipping tracking info to an order after shipping the item. Provides the buyer with a tracking number and carrier.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
orderIdYesThe order ID
carrierYesShipping carrier: UPS, FedEx, USPS, DHL, etc.
trackingNumberYesCarrier tracking number
sellerAddressNoSeller wallet address (for verification). Uses W3SHIP_PUBLIC_KEY if not provided.

Implementation Reference

  • The handler logic for the 'add_tracking' tool, which forwards a tracking update request to the W3SHIP_API.
    case 'add_tracking': {
        const { orderId: trackOrderId, carrier: trackCarrier, trackingNumber: trackNum, sellerAddress: trackSeller } = args as any;
        try {
            const trackRes = await fetch(`${W3SHIP_API}/api/shipment`, {
                method: 'POST',
                headers: { 'Content-Type': 'application/json' },
                body: JSON.stringify({
                    orderId: trackOrderId,
                    carrier: trackCarrier,
                    trackingNumber: trackNum,
                    sellerAddress: trackSeller || CONFIGURED_KEY,
                }),
            });
            const trackData = await trackRes.json() as any;
    
            if (!trackRes.ok) {
                return {
                    content: [{ type: 'text', text: `Error adding tracking: ${trackData.error || 'Unknown error'}` }],
                    isError: true,
                };
            }
    
            return {
                content: [{
                    type: 'text',
                    text: JSON.stringify({
                        orderId: trackOrderId,
                        carrier: trackCarrier,
                        trackingNumber: trackNum,
                        shipmentId: trackData.shipment?.id || trackData.shipmentId,
                        message: `Tracking added! Buyer can now track their shipment via ${trackCarrier}: ${trackNum}`,
                    }, null, 2)
                }]
            };
        } catch (e: any) {
            return { content: [{ type: 'text', text: `Error adding tracking: ${e.message}` }], isError: true };
        }
    }
  • The schema definition for the 'add_tracking' tool in the tool listing handler.
        name: 'add_tracking',
        description: 'Seller tool: Add real shipping tracking info to an order after shipping the item. Provides the buyer with a tracking number and carrier.',
        inputSchema: {
            type: 'object',
            properties: {
                orderId: { type: 'string', description: 'The order ID' },
                carrier: { type: 'string', description: 'Shipping carrier: UPS, FedEx, USPS, DHL, etc.' },
                trackingNumber: { type: 'string', description: 'Carrier tracking number' },
                sellerAddress: { type: 'string', description: 'Seller wallet address (for verification). Uses W3SHIP_PUBLIC_KEY if not provided.' },
            },
            required: ['orderId', 'carrier', 'trackingNumber'],
        },
    },

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