top_customers_by_spend
Identify top customers by total spend from non-cancelled orders, with optional date range filtering. Returns each customer's name, order count, and total amount spent.
Instructions
Top customers by total spend (sum of orders.total_amount), EXCLUDING cancelled orders. Optionally filter by a date range on order_date. Each row: { customer_id, name, orders, total_spent }. Default limit 10.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "top_customers_by_spend"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | No | Only include orders with order_date <= this ISO date/datetime. | |
| from | No | Only include orders with order_date >= this ISO date/datetime. | |
| limit | No | Max customers to return. |