Skip to main content
Glama

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

NameRequiredDescriptionDefault
fulfillmentCenterIdNoPreferred fulfillment center ID
itemsYesItems to ship
orderIdYesThe ID of the order to create a shipment for
shippingMethodYesShipping method to use

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "fulfillmentCenterId": { "description": "Preferred fulfillment center ID", "type": "string" }, "items": { "description": "Items to ship", "items": { "additionalProperties": false, "properties": { "orderItemId": { "description": "Order item ID to ship", "type": "string" }, "quantity": { "description": "Quantity to ship", "type": "number" } }, "required": [ "orderItemId", "quantity" ], "type": "object" }, "type": "array" }, "orderId": { "description": "The ID of the order to create a shipment for", "type": "string" }, "shippingMethod": { "description": "Shipping method to use", "type": "string" } }, "required": [ "orderId", "shippingMethod", "items" ], "type": "object" }

Implementation Reference

  • 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 }; } }
  • 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);
  • Helper method in ShipBobClient that performs the actual API call to create a shipment.
    async createShipment(shipmentData) { return this.request('POST', '/shipments', shipmentData); }

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/mattcoatsworth/shipbob-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server