Skip to main content
Glama

list_shipments

Retrieve shipment data from ShipBob's fulfillment API by filtering with order ID, date range, or pagination parameters for efficient tracking and management.

Input Schema

NameRequiredDescriptionDefault
endDateNoEnd date for filtering (YYYY-MM-DD)
limitNoNumber of shipments per page
orderIdNoFilter by order ID
pageNoPage number for pagination
startDateNoStart date for filtering (YYYY-MM-DD)

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "endDate": { "description": "End date for filtering (YYYY-MM-DD)", "type": "string" }, "limit": { "description": "Number of shipments per page", "type": "number" }, "orderId": { "description": "Filter by order ID", "type": "string" }, "page": { "description": "Page number for pagination", "type": "number" }, "startDate": { "description": "Start date for filtering (YYYY-MM-DD)", "type": "string" } }, "type": "object" }

Implementation Reference

  • The main handler function for the 'list_shipments' tool. It collects parameters, calls shipbobClient.getShipments(), formats the response as JSON text, or returns an error message.
    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 }; } }
  • Zod schema defining the input parameters for the list_shipments tool, all optional with descriptions.
    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)") },
  • The complete tool definition object for 'list_shipments', including name, description, schema, and handler, added to the fulfillmentTools export 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 }; } } },
  • src/server.js:50-58 (registration)
    Calls registerTools(fulfillmentTools) which loops over the array and registers each tool (including list_shipments) with the MCP server using server.tool().
    registerTools(productTools); registerTools(orderTools); registerTools(inventoryTools); registerTools(fulfillmentTools); registerTools(webhookTools); registerTools(returnTools); registerTools(locationTools); registerTools(channelTools); registerTools(reportingTools);
  • Helper method in ShipBobClient that makes the actual API request to list shipments, called by the tool handler.
    async getShipments(params) { return this.request('GET', '/shipments', null, params); }

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