Void Shipment
void_shipmentCancel a shipment and void its label before pickup, invalidating the tracking number for shipments not yet tendered to UPS.
Instructions
Cancel a shipment and void its label. Use when a shipment has been created but not yet picked up or tendered to UPS. The tracking number becomes invalid after voiding.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| shipmentIdentificationNumber | Yes | The shipment identification number returned from create_shipment |
Implementation Reference
- src/tools/shipping.ts:123-130 (handler)The async handler function that executes the void_shipment logic. It calls DELETE /api/shipments/{version}/void/cancel/{shipmentIdentificationNumber} via the UPS HTTP client and returns the formatted response.
async ({ shipmentIdentificationNumber }) => { const response = await client.delete<unknown>( `/api/shipments/${API_VERSIONS.SHIPPING}/void/cancel/${shipmentIdentificationNumber}`, ); return formatToolResponse(response); }, ); - src/tools/shipping.ts:111-130 (registration)Registration of the 'void_shipment' tool on the MCP server with its title, description, and inputSchema. The handler is the callback on lines 123-129.
server.registerTool( 'void_shipment', { title: 'Void Shipment', description: 'Cancel a shipment and void its label. Use when a shipment has been created but not yet picked up or tendered to UPS. The tracking number becomes invalid after voiding.', inputSchema: { shipmentIdentificationNumber: z .string() .describe('The shipment identification number returned from create_shipment'), }, }, async ({ shipmentIdentificationNumber }) => { const response = await client.delete<unknown>( `/api/shipments/${API_VERSIONS.SHIPPING}/void/cancel/${shipmentIdentificationNumber}`, ); return formatToolResponse(response); }, ); - src/tools/shipping.ts:117-121 (schema)Input schema for void_shipment, requiring a 'shipmentIdentificationNumber' string field.
inputSchema: { shipmentIdentificationNumber: z .string() .describe('The shipment identification number returned from create_shipment'), }, - src/types/shipping.ts:248-251 (schema)TypeScript interface VoidShipmentResult defining the shape of the response from voiding a shipment: status and statusCode strings.
export interface VoidShipmentResult { readonly status: string; readonly statusCode: string; } - src/tools/index.ts:3-16 (helper)Re-exports addShippingTools (which registers void_shipment) from the shipping module.
export { addShippingTools } from './shipping.js'; export { addRatingTools } from './rating.js'; export { addPickupTools } from './pickup.js'; export { addLocatorTools } from './locator.js'; export { API_VERSIONS, DOMESTIC_SERVICES, INTERNATIONAL_SERVICES, REGIONAL_SERVICES, MAIL_INNOVATIONS_SERVICES, SERVICE_CODES, PACKAGING_TYPES, FREIGHT_PACKAGING_TYPES,