create_shipment
Create a shipment for an order using the ShipBob API by specifying the order ID, shipping method, items, and optional fulfillment center ID.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fulfillmentCenterId | No | Preferred fulfillment center ID | |
| items | Yes | Items to ship | |
| orderId | Yes | The ID of the order to create a shipment for | |
| shippingMethod | Yes | Shipping method to use |
Implementation Reference
- src/tools/fulfillment-tools.js:70-85 (handler)MCP tool handler for 'create_shipment' that calls the ShipBob API client to create the shipment and handles the response.handler: async (shipmentData) => { try { const newShipment = await shipbobClient.createShipment(shipmentData); return { content: [{ type: "text", text: `Shipment created successfully: ${JSON.stringify(newShipment, null, 2)}` }] }; } catch (error) { return { content: [{ type: "text", text: `Error creating shipment: ${error.message}` }], isError: true }; } }
- src/tools/fulfillment-tools.js:59-69 (schema)Input schema using Zod for validating parameters to the create_shipment tool.schema: { orderId: z.string().describe("The ID of the order to create a shipment for"), fulfillmentCenterId: z.string().optional().describe("Preferred fulfillment center ID"), shippingMethod: z.string().describe("Shipping method to use"), items: z.array( z.object({ orderItemId: z.string().describe("Order item ID to ship"), quantity: z.number().describe("Quantity to ship") }) ).describe("Items to ship") },
- src/server.js:53-53 (registration)Registers the fulfillmentTools array containing the create_shipment tool with the MCP server.registerTools(fulfillmentTools);
- src/api-client.js:114-116 (helper)Helper method in ShipBobClient that performs the actual API call to create a shipment.async createShipment(shipmentData) { return this.request('POST', '/shipments', shipmentData); }