delete_cart
Remove a shopping cart from the W3Ship MCP Server by providing its public key ID, clearing stored cart data.
Instructions
Delete a shopping cart.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Public key ID of the cart |
Implementation Reference
- src/cart/service.ts:67-69 (handler)The deleteCart function in ValkeyService performs the actual deletion from Redis.
async deleteCart(cartId: string): Promise<void> { await this.getClient().del(`cart:${cartId}`); } - src/index.ts:457-464 (handler)The CallToolRequestSchema handler for 'delete_cart' in src/index.ts invokes ValkeyService.deleteCart.
case 'delete_cart': { const id = (args?.id as string) || CONFIGURED_KEY; if (!id) { return { content: [{ type: 'text', text: 'Error: No cart ID. Set W3SHIP_PUBLIC_KEY or provide an id.' }], isError: true }; } await valkeyService.deleteCart(id); return { content: [{ type: 'text', text: `Cart ${id} deleted successfully.` }] }; } - src/index.ts:124-133 (registration)The delete_cart tool is registered in the list of tools returned by the MCP server.
name: 'delete_cart', description: 'Delete a shopping cart.', inputSchema: { type: 'object', properties: { id: { type: 'string', description: 'Public key ID of the cart' }, }, required: ['id'], }, },