list_shipments
Retrieve shipment data from ShipBob's fulfillment system with filtering options for order ID, date ranges, and pagination controls.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| page | No | Page number for pagination | |
| limit | No | Number of shipments per page | |
| orderId | No | Filter by order ID | |
| startDate | No | Start date for filtering (YYYY-MM-DD) | |
| endDate | No | End date for filtering (YYYY-MM-DD) |
Implementation Reference
- src/tools/fulfillment-tools.js:15-31 (handler)The handler function executes the tool logic by calling shipbobClient.getShipments with pagination and filter parameters, formats the response as JSON, and handles errors.handler: async ({ page, limit, orderId, startDate, endDate }) => { try { const params = { page, limit, orderId, startDate, endDate }; const shipments = await shipbobClient.getShipments(params); return { content: [{ type: "text", text: JSON.stringify(shipments, null, 2) }] }; } catch (error) { return { content: [{ type: "text", text: `Error listing shipments: ${error.message}` }], isError: true }; } }
- src/tools/fulfillment-tools.js:8-14 (schema)Zod schema defining the input parameters for the list_shipments tool: optional page, limit, orderId, startDate, endDate.schema: { page: z.number().optional().describe("Page number for pagination"), limit: z.number().optional().describe("Number of shipments per page"), orderId: z.string().optional().describe("Filter by order ID"), startDate: z.string().optional().describe("Start date for filtering (YYYY-MM-DD)"), endDate: z.string().optional().describe("End date for filtering (YYYY-MM-DD)") },
- src/tools/fulfillment-tools.js:5-32 (registration)The tool 'list_shipments' is registered as part of the exported fulfillmentTools array.{ name: "list_shipments", description: "List shipments in your ShipBob account", schema: { page: z.number().optional().describe("Page number for pagination"), limit: z.number().optional().describe("Number of shipments per page"), orderId: z.string().optional().describe("Filter by order ID"), startDate: z.string().optional().describe("Start date for filtering (YYYY-MM-DD)"), endDate: z.string().optional().describe("End date for filtering (YYYY-MM-DD)") }, handler: async ({ page, limit, orderId, startDate, endDate }) => { try { const params = { page, limit, orderId, startDate, endDate }; const shipments = await shipbobClient.getShipments(params); return { content: [{ type: "text", text: JSON.stringify(shipments, null, 2) }] }; } catch (error) { return { content: [{ type: "text", text: `Error listing shipments: ${error.message}` }], isError: true }; } } },