get_orders_missing_listings
Detect TCGplayer orders that never completed listing sync by comparing orders to listings; flags any order lacking an auto-created or manual listing, revealing missing inventory syncs.
Instructions
Find TCGplayer orders whose listing/inventory sync never completed — a direct comparison of tcgplayer_orders/tcgplayer_order_items against tcgplayer_listings, not an inference from quantity_listed or updated_at (those can shift for unrelated reasons, e.g. a price refresh, and give a false read). An order counts as synced if it has its own auto-created listing (tcgplayer_listings.notes = "Auto-created from TCGplayer order "), or if listing creation was correctly skipped because a manual listing already covered one of its cards within 3 days of the order date — the same duplicate-sale guard create_tcgplayer_order itself uses. An auto-created listing belonging to a different order never counts as coverage, since that guard only ever fires against manual listings. Anything else is flagged as missing, listing every line item on the order since a failed sync never lists any of them. Run with since set to the start of an order-capture run to catch a bad sync within the hour; run with no since for a full backlog sweep.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Max number of missing orders to return. checked_count/missing_count still reflect the full since-filtered set. | |
| since | No | Optional ISO date/datetime — only check orders with created_at >= this. Omit to check every order on file. |