create_label
Generate shipping labels by processing JSON-formatted label data through the ShipStation API MCP Server, streamlining order fulfillment and shipment management.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| labelData | Yes | JSON string containing the label data |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"labelData": {
"description": "JSON string containing the label data",
"type": "string"
}
},
"required": [
"labelData"
],
"type": "object"
}
Implementation Reference
- src/tools/shipment-tools.js:60-73 (handler)The MCP tool handler function that parses the JSON labelData, calls the ShipStation API via shipStationClient.createLabel, formats the result as text content, and handles errors.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)Zod input schema for the create_label tool, expecting a JSON string with label data.schema: { labelData: z.string().describe("JSON string containing the label data") },
- src/server.js:173-191 (registration)Registration code that spreads shipmentTools (containing create_label) and registers each tool with the MCP server using server.tool().// 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:93-95 (helper)Helper method in ShipStationClient that makes the POST request to ShipStation API endpoint /shipments/createlabel, called by the tool handler.async createLabel(data) { return this.request('POST', '/shipments/createlabel', data); }