get_shipment
Retrieve detailed shipment information by providing a valid shipment ID through the ShipBob fulfillment API, enabling efficient tracking and management of e-commerce orders.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| shipmentId | Yes | The ID of the shipment to retrieve |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"shipmentId": {
"description": "The ID of the shipment to retrieve",
"type": "string"
}
},
"required": [
"shipmentId"
],
"type": "object"
}
Implementation Reference
- src/tools/fulfillment-tools.js:39-54 (handler)Handler function for the 'get_shipment' MCP tool. Retrieves shipment details using shipbobClient.getShipment(shipmentId), formats as JSON text response or error.handler: async ({ shipmentId }) => { try { const shipment = await shipbobClient.getShipment(shipmentId); return { content: [{ type: "text", text: JSON.stringify(shipment, null, 2) }] }; } catch (error) { return { content: [{ type: "text", text: `Error retrieving shipment: ${error.message}` }], isError: true }; } }
- src/tools/fulfillment-tools.js:36-38 (schema)Zod input schema for 'get_shipment' tool requiring 'shipmentId' as string.schema: { shipmentId: z.string().describe("The ID of the shipment to retrieve") },
- src/tools/fulfillment-tools.js:33-55 (registration)Tool object definition for 'get_shipment' within the fulfillmentTools array, including name, description, schema, and handler.{ name: "get_shipment", description: "Get details of a specific shipment by ID", schema: { shipmentId: z.string().describe("The ID of the shipment to retrieve") }, handler: async ({ shipmentId }) => { try { const shipment = await shipbobClient.getShipment(shipmentId); return { content: [{ type: "text", text: JSON.stringify(shipment, null, 2) }] }; } catch (error) { return { content: [{ type: "text", text: `Error retrieving shipment: ${error.message}` }], isError: true }; } } },
- src/server.js:53-53 (registration)Registers the fulfillmentTools array (containing 'get_shipment') with the MCP server via registerTools(fulfillmentTools).registerTools(fulfillmentTools);
- src/api-client.js:110-112 (helper)ShipBobClient.getShipment(id) helper method that performs the actual API request to retrieve a specific shipment.async getShipment(id) { return this.request('GET', `/shipments/${id}`); }