list_carrier_packages
Retrieve available package types for a specific carrier in ShipStation to ensure proper shipping configuration.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| carrierCode | Yes | Carrier code (e.g., 'ups', 'fedex', 'usps') |
Implementation Reference
- src/tools/carrier-tools.js:29-41 (handler)The MCP tool handler that fetches carrier packages using shipStationClient.getCarrierPackages and returns formatted JSON response or error.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)Zod input schema defining the required 'carrierCode' string parameter.schema: { carrierCode: z.string().describe("Carrier code (e.g., 'ups', 'fedex', 'usps')") },
- src/server.js:184-191 (registration)Registration loop that dynamically registers all tools (including 'list_carrier_packages') with the MCP server using server.tool(name, schema, handler).].forEach(tool => { server.tool( tool.name, tool.schema, tool.handler, { description: tool.description } ); });
- src/api-client.js:106-108 (helper)ShipStationClient helper method that performs the API GET request to retrieve packages for the specified carrier.async getCarrierPackages(carrierCode) { return this.request('GET', '/carriers/listpackages', null, { carrierCode }); }