clear-cart
Remove all items from your Terminal.shop shopping cart to start fresh or cancel a planned purchase.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- server.js:689-713 (handler)The inline handler for the clear-cart tool. It sends a DELETE request to /cart via terminalApi, returns a success message if cleared, or an error message if failed.server.tool("clear-cart", {}, async () => { try { const response = await terminalApi.delete("/cart"); return { content: [ { type: "text", text: "Your cart has been cleared successfully.", }, ], }; } catch (error) { console.error("Error clearing cart:", error); return { content: [ { type: "text", text: `Error clearing cart: ${error.message}`, }, ], isError: true, }; } });
- server.js:689-689 (registration)Registration of the 'clear-cart' tool using server.tool with empty input schema and inline handler function.server.tool("clear-cart", {}, async () => {