Skip to main content
Glama
baskcart

W3Ship MCP Server

by baskcart

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
NameRequiredDescriptionDefault
idYesPublic key ID of the cart

Implementation Reference

  • The deleteCart function in ValkeyService performs the actual deletion from Redis.
    async deleteCart(cartId: string): Promise<void> {
        await this.getClient().del(`cart:${cartId}`);
    }
  • 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'],
        },
    },

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/baskcart/w3ship-mcp-server'

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