Order Query Tool Stable

查詢訂單資訊的工具。支援多種查詢方式,包含訂單查詢、會員統計、出貨時間查詢。

Available Methods

Tool Name 參數 說明
query_order_by_number lineId, orderNumber 根據訂單編號查詢訂單詳細資訊 (⚠️ 需綁定 LINE ID)
query_orders_by_mobile lineId, mobile 根據手機號碼查詢會員最近 90 天的訂單 (最多 10 筆,⚠️ 需綁定 LINE ID)
query_orders_by_email lineId, email 根據 Email 查詢會員最新 10 筆訂單 (⚠️ 需綁定 LINE ID)
query_member_stats_by_mobile New lineId, mobile 查詢會員消費統計 (總訂單數、總金額、已付/未付)
query_order_shipping_status New lineId, orderNumber 查詢訂單商品的預計出貨時間
query_delivery_status New lineId, orderNumber 查詢黑貓宅急便配送狀態明細

query_order_by_number

根據訂單編號查詢訂單詳細資訊,包含收件人、金額、商品明細等。⚠️ 需要提供 LINE User ID 進行身份驗證。

請求範例

{ "jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": { "name": "query_order_by_number", "arguments": { "lineId": "U1234567890abcdef", "orderNumber": "250117518040" } } }

回應範例

{ "result": { "content": [{ "type": "text", "text": "{\"success\":true,\"data\":{\"orderNumber\":\"250117518040\",\"amount\":1234,\"status\":\"已出貨\"}}" }] } }

query_member_stats_by_mobile New

查詢會員的消費統計資料,包含總訂單數、總金額、已付款金額、未付款金額等。⚠️ 需要提供 LINE User ID 進行身份驗證。

請求範例

{ "jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": { "name": "query_member_stats_by_mobile", "arguments": { "lineId": "U1234567890abcdef", "mobile": "0912345678" } } }

回應範例

{ "success": true, "statistics": { "totalOrders": 15, "totalAmount": 12500, "paidOrders": 12, "paidAmount": 10000, "unpaidOrders": 3, "unpaidAmount": 2500 }, "summary": "共 15 筆訂單,總消費 NT$12,500 (已付款 NT$10,000)" }

query_order_shipping_status New

查詢訂單中各商品的預計出貨時間,包含出貨區間、商品備註、物流單號等資訊。⚠️ 需要提供 LINE User ID 進行身份驗證。

注意事項

預計出貨時間僅供參考,實際出貨可能因庫存、物流等因素有所調整,請以實際出貨通知為準。

請求範例

{ "jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": { "name": "query_order_shipping_status", "arguments": { "lineId": "U1234567890abcdef", "orderNumber": "250117518040" } } }

回應範例

{ "success": true, "orderNumber": "250117518040", "orderInfo": { "orderStatus": "待出貨", "trackingNumber": null }, "products": [ { "productName": "有機蔬菜箱", "quantity": 1, "shippingPeriod": "2025/01/20 ~ 2025/01/25", "productRemark": "現貨", "shippingStatus": "待出貨" } ], "notice": "⚠️ 以上為預計出貨時間,實際出貨可能因庫存、物流等因素有所調整" }

query_delivery_status New

查詢訂單的黑貓宅急便配送狀態明細。⚠️ 需要提供 LINE User ID 進行身份驗證。如果訂單尚未寄出,會回傳「尚未寄出」狀態。

配送追蹤

此工具會直接查詢黑貓宅急便官方網站,取得最新的配送進度,包含時間、狀態、負責營業所。

請求範例

{ "jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": { "name": "query_delivery_status", "arguments": { "lineId": "U1234567890abcdef", "orderNumber": "250117518040" } } }

回應範例 (已寄出)

{ "success": true, "orderNumber": "250117518040", "customerName": "王小明", "trackingNumber": "907390733324", "currentStatus": "順利送達", "deliveryHistory": [ { "time": "2025/11/06 16:24", "status": "順利送達", "location": "萬華營業所" }, { "time": "2025/11/06 10:26", "status": "配送中", "location": "萬華營業所" }, { "time": "2025/11/06 05:34", "status": "配送中", "location": "萬華營業所" }, { "time": "2025/11/05 17:42", "status": "已集貨", "location": "梨山營業所" } ], "trackingUrl": "https://www.t-cat.com.tw/inquire/TraceDetail.aspx?BillID=907390733324" }

回應範例 (尚未寄出)

{ "success": true, "orderNumber": "250117518040", "customerName": "王小明", "status": "尚未寄出", "message": "此訂單尚未交付物流配送,請耐心等候出貨通知。", "trackingNumber": null }

Testing

測試訂單查詢

相關文件