top_customers
Rank customers by total spend or order count. Use by='spend' to sum revenue from completed and shipped orders, or by='order_count' to count non-cancelled orders.
Instructions
Rank customers either by total spend or by number of placed orders.
by='spend': sums orders.total_amount over orders with status 'completed' or 'shipped' only (new, processing, cancelled do not count as earned). Returns first_name, last_name, email, total_spend.
by='order_count': counts orders whose status is NOT 'cancelled'. Returns first_name, last_name, email, order_count. Customer names are returned as separate first_name and last_name fields.
limitdefaults to 100 (max 1000);offsetpaginates.
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"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| by | No | spend | |
| limit | No | ||
| offset | No |