Skip to main content

Overview

File: src/tools/BasketTool.ts Nine tools demonstrating the complete shopping cart workflow from creation to checkout.

The Complete Shopping Flow

1

Create Basket

Start a new shopping session
2

Add Items

Add products to cart (can add multiple)
3

Manage Cart

Remove items, update quantities, add notes
4

Checkout

Convert basket to order

Key Tools

CreateBasketTool

AddItemToBasketTool

CheckoutBasketTool

All 9 Tools

  1. CreateBasketTool - Start shopping
  2. GetBasketsTool - List all baskets
  3. AddItemToBasketTool - Add products
  4. RemoveItemFromBasketTool - Remove products
  5. ClearBasketTool - Empty cart
  6. UpdateBasketStatusTool - Change status
  7. UpdateBasketMetadataTool - Add notes/data
  8. CheckoutBasketTool - Convert to order
  9. GetBasketByIdTool - View specific basket

Testing the Flow

Select sandbox mode, then try this conversation:
  1. “Create a shopping basket”
  2. “Search for laptop”
  3. “Add that laptop to my basket”
  4. “Show me my cart”
  5. “Checkout with shipping to 123 Main St, New York”

What You’ll Learn

Multi-Step Workflows

Handle complex processes

State Management

Track cart state over time

API Chaining

Combine multiple API calls

Business Logic

Implement e-commerce rules

Next Steps

Baskets API

Complete API reference

Orders API

Manage orders after checkout