create_label
Generate shipping labels for orders by providing label data in JSON format to streamline fulfillment processes.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| labelData | Yes | JSON string containing the label data |
Implementation Reference
- src/tools/shipment-tools.js:60-73 (handler)Handler function for the 'create_label' MCP tool. Parses the labelData JSON string and delegates to shipStationClient.createLabel(), returning the result or error response.handler: async ({ labelData }) => { try { const parsedData = JSON.parse(labelData); const result = await shipStationClient.createLabel(parsedData); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] }; } catch (error) { return { content: [{ type: "text", text: error.message }], isError: true }; } }
- src/tools/shipment-tools.js:57-59 (schema)Input schema for the create_label tool, defining labelData as a JSON string using Zod.schema: { labelData: z.string().describe("JSON string containing the label data") },
- src/server.js:174-191 (registration)Registers all MCP tools including the 'create_label' tool from shipmentTools array by iterating and calling 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:93-95 (helper)ShipStationClient.createLabel method invoked by the tool handler, which sends a POST request to the ShipStation API endpoint '/shipments/createlabel'.async createLabel(data) { return this.request('POST', '/shipments/createlabel', data); }