void_label
Cancel shipping labels in ShipStation by submitting the shipment ID directly via the API. Simplify label voiding for order management and fulfillment workflows.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| shipmentId | Yes | Shipment ID of the label to void |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"shipmentId": {
"description": "Shipment ID of the label to void",
"type": "number"
}
},
"required": [
"shipmentId"
],
"type": "object"
}
Implementation Reference
- src/tools/shipment-tools.js:81-93 (handler)Handler function for the 'void_label' MCP tool. Takes shipmentId, calls shipStationClient.voidLabel, returns JSON result or error response.handler: async ({ shipmentId }) => { try { const result = await shipStationClient.voidLabel({ shipmentId }); 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:78-80 (schema)Zod input schema for 'void_label' tool: requires a numeric shipmentId.schema: { shipmentId: z.number().describe("Shipment ID of the label to void") },
- src/tools/shipment-tools.js:75-94 (registration)Tool registration object for 'void_label' exported as part of shipmentTools array, later spread and registered in MCP server.{ name: "void_label", description: "Void a shipping label", schema: { shipmentId: z.number().describe("Shipment ID of the label to void") }, handler: async ({ shipmentId }) => { try { const result = await shipStationClient.voidLabel({ shipmentId }); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] }; } catch (error) { return { content: [{ type: "text", text: error.message }], isError: true }; } } }
- src/api-client.js:97-99 (helper)ShipStationClient helper method voidLabel that performs the actual POST request to ShipStation API endpoint /shipments/voidlabel.async voidLabel(data) { return this.request('POST', '/shipments/voidlabel', data); }
- src/server.js:174-191 (registration)MCP server registration code that spreads shipmentTools (containing void_label) and calls server.tool for each tool.[ ...orderTools, ...shipmentTools, ...carrierTools, ...warehouseTools, ...productTools, ...customerTools, ...storeTools, ...webhookTools, ...fulfillmentTools ].forEach(tool => { server.tool( tool.name, tool.schema, tool.handler, { description: tool.description } ); });