list_carrier_packages
Retrieve available package types for a specific carrier using the ShipStation API. Input the carrier code to generate a list of valid packages for shipping management.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| carrierCode | Yes | Carrier code (e.g., 'ups', 'fedex', 'usps') |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"carrierCode": {
"description": "Carrier code (e.g., 'ups', 'fedex', 'usps')",
"type": "string"
}
},
"required": [
"carrierCode"
],
"type": "object"
}
Implementation Reference
- src/tools/carrier-tools.js:29-41 (handler)The handler function for the list_carrier_packages tool. It fetches packages for the given carrierCode using shipStationClient and returns formatted JSON or an error response.handler: async ({ carrierCode }) => { try { const packages = await shipStationClient.getCarrierPackages(carrierCode); return { content: [{ type: "text", text: JSON.stringify(packages, null, 2) }] }; } catch (error) { return { content: [{ type: "text", text: error.message }], isError: true }; } }
- src/tools/carrier-tools.js:26-28 (schema)Input schema using Zod for the carrierCode parameter.schema: { carrierCode: z.string().describe("Carrier code (e.g., 'ups', 'fedex', 'usps')") },
- src/server.js:174-191 (registration)Registration of all tools, including list_carrier_packages from carrierTools array, using the MCP server's tool() method.[ ...orderTools, ...shipmentTools, ...carrierTools, ...warehouseTools, ...productTools, ...customerTools, ...storeTools, ...webhookTools, ...fulfillmentTools ].forEach(tool => { server.tool( tool.name, tool.schema, tool.handler, { description: tool.description } ); });