wc_get_coupon_count: count coupons
Returns how many coupons exist in each post status.
Arguments
None.
Permissions
mcp:read and woocommerce:catalog:read, plus manage_woocommerce or edit_shop_coupons.
What it returns
counts, keyed by status: publish, draft, trash, pending, private, auto-draft and any other status registered on the site.
Every registered status appears, including ones with a count of zero, so the response is longer than the number of statuses actually in use.
It is the total the listing does not give you
wc_get_coupons caps at 100, does not paginate and reports no total. This tool is the only way to know whether a listing was complete.
Get the coupon count, then list the published coupons, and tell me whether I have seen all of them.
If publish is 143 and the listing returned 100, forty-three coupons are live and unaccounted for. Nothing in the listing says so.
The trash count is the operationally interesting one
Trashed coupons still hold their codes. A shop with sixty trashed coupons is a shop where sixty codes cannot be reused, and where an attempt to recreate one fails for a reason that is not obvious.
It is also what you check before wc_empty_coupon_trash, which purges permanently and 100 at a time:
How many coupons are in the trash?
A count above 100 means the purge tool needs running more than once.
Drafts are prepared campaigns
A large draft count usually means coupons staged for a future promotion. They are invisible to the default listing, and they are the ones a broad instruction like "review our discounts" will miss entirely.
Worth surfacing before anyone concludes the shop has few offers.
It counts, it does not qualify
The response says how many coupons exist per status, and nothing about them. It cannot tell you:
- how many have expired — expiry is per-coupon, and only in the full read;
- how many are actually redeemable today;
- how many have been used.
So publish: 143 is not "143 working discount codes". It is 143 coupons that are not drafts and not trashed, most of which may be long dead. Redemption data is not available through MCP at all — see Orders and customers are not exposed.
Using it well
At the start of any coupon work:
Get the coupon count and show me the breakdown.
That one call tells you the size of the problem: whether listings will be complete, whether there is a trash backlog, and whether staged campaigns exist.
Common problems
| Symptom | Cause |
|---|---|
| The tool is missing | WooCommerce is not active |
pom_ai_mcp_wc_forbidden |
Missing manage_woocommerce or edit_shop_coupons |
| Statuses you do not recognise | All registered statuses are returned, including empty ones |
| A count higher than the shop seems to have | Trash and drafts are included |
| No usage or redemption figures | Not exposed by any MCP tool |
Related
wc_get_couponswc_empty_coupon_trashwc_get_store_stats— includes coupon counts too