list_carrier_services
Retrieve available shipping services for a specific carrier to select appropriate delivery options when creating shipments.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| carrierCode | Yes | Carrier code (e.g., 'ups', 'fedex', 'usps') |
Implementation Reference
- src/tools/carrier-tools.js:49-61 (handler)The main handler function for the 'list_carrier_services' tool. It takes carrierCode as input, calls shipStationClient.getCarrierServices, and returns the services as formatted JSON or an error message.handler: async ({ carrierCode }) => { try { const services = await shipStationClient.getCarrierServices(carrierCode); return { content: [{ type: "text", text: JSON.stringify(services, null, 2) }] }; } catch (error) { return { content: [{ type: "text", text: error.message }], isError: true }; } }
- src/tools/carrier-tools.js:46-48 (schema)Zod schema defining the input parameter 'carrierCode' as a required string with description.schema: { carrierCode: z.string().describe("Carrier code (e.g., 'ups', 'fedex', 'usps')") },
- src/server.js:173-191 (registration)Tool registration loop in the MCP server that spreads the carrierTools array (among others) and registers each tool by calling server.tool with its name, schema, handler, and description.// Register all tools [ ...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:110-112 (helper)Helper method in ShipStationClient that performs the actual API request to ShipStation's /carriers/listservices endpoint with the carrierCode parameter.async getCarrierServices(carrierCode) { return this.request('GET', '/carriers/listservices', null, { carrierCode }); }