Skip to main content
Glama
baskcart

W3Ship MCP Server

by baskcart

track_shipment

Check the delivery status of your shipment using the Shipment ID or Order ID to monitor its progress and location.

Instructions

Track the delivery status of a shipment (TMF621).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
shipmentIdNoThe unique Shipment ID
orderIdNoThe Order ID (optional, to lookup shipment)

Implementation Reference

  • The handler implementation for the `track_shipment` tool, located in the `src/index.ts` file as part of the main `CallToolRequestSchema` request handler switch case.
    case 'track_shipment': {
        const { shipmentService } = await import('./shipment/service.js');
        const shipmentId = args?.shipmentId as string;
        const orderId = args?.orderId as string;
    
        let shipment;
        if (shipmentId) {
            shipment = await shipmentService.getShipment(shipmentId);
        } else if (orderId) {
            shipment = await shipmentService.getShipmentByOrderId(orderId);
        } else {
            return { content: [{ type: 'text', text: `Error: Must provide shipmentId or orderId.` }], isError: true };
        }
    
        if (!shipment) {
            return { content: [{ type: 'text', text: `Error: Shipment not found.` }], isError: true };
        }
    
        // Simulate status update based on time elapsed
        const createdTime = new Date(shipment.events[0].timestamp).getTime();
        const now = Date.now();
        const minutesElapsed = (now - createdTime) / 60000;
    
        let newStatus = shipment.status;
        if (minutesElapsed > 5 && shipment.status === 'Label Created') newStatus = 'Picked Up';
        else if (minutesElapsed > 10 && shipment.status === 'Picked Up') newStatus = 'In Transit';
        else if (minutesElapsed > 20 && shipment.status === 'In Transit') newStatus = 'Out for Delivery';
        else if (minutesElapsed > 30 && shipment.status === 'Out for Delivery') newStatus = 'Delivered';
    
        if (newStatus !== shipment.status) {
            shipment.status = newStatus as any;
            shipment.events.push({
                timestamp: new Date().toISOString(),
                status: newStatus,
                description: `Status updated to ${newStatus}`
            });
            await shipmentService.updateShipment(shipment);
        }
    
        return { content: [{ type: 'text', text: JSON.stringify(shipment, null, 2) }] };
    }
  • The tool definition and input schema for `track_shipment` in the `ListToolsRequestSchema` handler.
        name: 'track_shipment',
        description: 'Track the delivery status of a shipment (TMF621).',
        inputSchema: {
            type: 'object',
            properties: {
                shipmentId: { type: 'string', description: 'The unique Shipment ID' },
                orderId: { type: 'string', description: 'The Order ID (optional, to lookup shipment)' },
            },
        },
    },
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. While 'Track' implies a read operation, the description does not confirm it is read-only, describe the return format, mention error cases (e.g., invalid shipmentId), or disclose rate limits.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, front-loaded sentence with minimal waste. However, the '(TMF621)' reference adds limited value for an AI agent without additional context about this standard.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a two-parameter tool with simple string inputs and 100% schema coverage, the description is minimally adequate. However, given the lack of annotations and output schema, it should ideally describe the return value (tracking details) and confirm the read-only nature of the operation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 100% schema description coverage (both shipmentId and orderId are documented), the baseline score is 3. The description does not add semantic details beyond the schema (e.g., ID format examples or lookup semantics), but the schema already adequately defines the parameters.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action (Track), resource (shipment), and scope (delivery status). However, it does not explicitly distinguish from sibling tools like `add_tracking` (which likely adds tracking data rather than querying it) or `get_order` (which may also return status information).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives such as `get_order` or `add_tracking`, nor does it mention prerequisites like requiring a valid shipmentId or when to use the optional orderId parameter instead.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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