Find Orders
find_ordersLook up orders by exact ID or customer name to see line items with product names and prices. This is the drill-down from sales totals to what one customer bought.
Instructions
Looks up orders by exact order id or by customer name (case-insensitive substring match, so 'maya' finds 'Maya Chen') and returns each order's line items enriched with product name, unit price and line total. This is the drill-down behind the aggregates: analyze_sales_metrics reports what sold in total, this reports what a single order or customer actually bought. Results are newest first. Line prices come from the current catalog; a line whose product is no longer catalogued reports null rather than an invented price. Supplying both filters requires an order to satisfy both; the echoed 'filters' block reports the values actually matched on. A filter that matches nothing is a successful lookup with count 0 and an empty 'orders' array — the same answer list_all_products gives — not a tool error. Results are deliberately uncapped by default and there is no pagination: 'customer_name' is a substring match, so a broad query returns every matching order in the dataset (a one-letter name matches most of it). Pass 'limit' to bound a broad query — 'totalMatches' always reports how many matched in full, so a capped answer cannot be mistaken for a complete one. Narrow the filter rather than expecting a page, and prefer 'order_id' when you want a single order.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Return at most this many matches, newest first. 'totalMatches' still reports the full match count. Omit to return every match. | |
| order_id | No | Exact order id to fetch, e.g. 'ord_1042'. Case-insensitive. | |
| customer_name | No | Customer name to match, case-insensitively as a substring: 'maya' matches 'Maya Chen'. Use this to answer questions like 'what did Maya order?'. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| count | Yes | ||
| limit | Yes | ||
| orders | Yes | ||
| filters | Yes | ||
| totalMatches | Yes |