Skip to main content
Glama

Void Shipment

void_shipment

Cancel 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

TableJSON Schema
NameRequiredDescriptionDefault
shipmentIdentificationNumberYesThe shipment identification number returned from create_shipment

Implementation Reference

  • 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);
    	},
    );
  • 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);
    	},
    );
  • Input schema for void_shipment, requiring a 'shipmentIdentificationNumber' string field.
    inputSchema: {
    	shipmentIdentificationNumber: z
    		.string()
    		.describe('The shipment identification number returned from create_shipment'),
    },
  • 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;
    }
  • 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,
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It discloses that the tracking number becomes invalid, but does not mention irreversibility or effects on related data like pickups.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three sentences, front-loaded with the main action, no wasted words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple 1-parameter tool with no output schema, the description covers purpose, usage condition, and a consequence. Could mention permanence, but still fairly complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so baseline is 3. The description adds no additional parameter semantics beyond what the schema already provides.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'Cancel' and the resource 'a shipment', and distinguishes from siblings like 'cancel_pickup' by focusing on voiding the label.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly says 'Use when a shipment has been created but not yet picked up or tendered', providing clear usage context. It does not mention when not to use or offer alternatives.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/roscoej/ups-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server