shop_analytics
Run sales analytics without writing SQL: retrieve top customers by spend, customers with most orders, top products, top categories, and revenue by year. Specify the operation, optional year, and limit.
Instructions
Shop aggregations without hand-written SQL.
Operations: top_customers_by_spend (name, email, total_amount; default limit 5), customer_most_orders (name, email, order_count), top_products (product_name, units_sold, revenue; default limit 5), top_categories (category, revenue; default limit 3), revenue_by_year (requires year). Spend/units/revenue use quantity * unit_price and exclude cancelled orders. Year is taken from order_date.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"operation": "<operation>"
},
"name": "shop_analytics"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| year | No | ||
| limit | No | ||
| operation | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||