get_shipment
Retrieve detailed shipment information by providing the shipment ID using the ShipStation API MCP Server. Simplify tracking and management of orders and logistics.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| shipmentId | Yes | Shipment ID to retrieve |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"shipmentId": {
"description": "Shipment ID to retrieve",
"type": "number"
}
},
"required": [
"shipmentId"
],
"type": "object"
}
Implementation Reference
- src/tools/shipment-tools.js:40-52 (handler)The handler function that executes the 'get_shipment' tool logic: fetches shipment details via ShipStation API and returns JSON response or error.handler: async ({ shipmentId }) => { try { const shipment = await shipStationClient.getShipment(shipmentId); return { content: [{ type: "text", text: JSON.stringify(shipment, null, 2) }] }; } catch (error) { return { content: [{ type: "text", text: error.message }], isError: true }; } }
- src/tools/shipment-tools.js:37-39 (schema)Input schema using Zod for validating the required 'shipmentId' parameter.schema: { shipmentId: z.number().describe("Shipment ID to retrieve") },
- src/server.js:174-191 (registration)Registration code that spreads shipmentTools (containing 'get_shipment') and registers each tool with the MCP server using server.tool().[ ...orderTools, ...shipmentTools, ...carrierTools, ...warehouseTools, ...productTools, ...customerTools, ...storeTools, ...webhookTools, ...fulfillmentTools ].forEach(tool => { server.tool( tool.name, tool.schema, tool.handler, { description: tool.description } ); });
- src/api-client.js:89-91 (helper)ShipStationClient helper method that performs the actual API GET request for a specific shipment, called by the tool handler.async getShipment(shipmentId) { return this.request('GET', `/shipments/${shipmentId}`); }