Check WooCommerce stock
Module · Stable
Is this part in stock, how many, what does it cost, what is it, and where can the customer order it.
Looks one product up by SKU in the connected shop and reports whether it can actually be bought right now. Two different negatives, kept apart on purpose: found=false means the shop has no such SKU (the part number is wrong, or it isn’t a product we sell), while found=true with in_stock=false means the right part exists but there is none left. A reply that confuses those two is wrong in a way a customer will notice. Returns the product page link, which is what an order call-to-action should point at. Being a single-product lookup it also carries the product’s own description, cleaned of the shop’s page-builder markup — which is where what-is-in-the-box lives, and the only source for it. availability answers the different question of whether the business still SELLS the product at all — available, temporarily_unavailable, discontinued, or unknown. It is read from the shop’s own stock-state convention, which an admin declares under Settings, and it is unknown until they do. Never treat unknown as ‘available’ and never announce that something is discontinued unless this field says so: in_stock=false on its own means an empty shelf, not a retired product. Read-only.
When to use
Section titled “When to use”Before telling anyone they can order something — the call-to-action step should be gated on this, not on the drafting model’s belief. Also for plain availability questions, which are a steady share of any parts desk’s queue. And for ANY question about what a specific product is or includes: this carries the whole description, where the plural search carries only an excerpt. Never state what is or is not in the box without having read it — a customer was told tire levers were not included with a skidplate whose own description lists them, because nothing had fetched that description.
When not to use
Section titled “When not to use”Not for questions about an order already placed — that’s Find WooCommerce order. Not for whether a part fits a particular bike: stock and fitment are different questions and the shop only answers the first, so pair it with the fitment table rather than substituting for it. And when description_truncated is true, the description is an excerpt: not finding something in it is not evidence the product lacks it.
Inputs
Section titled “Inputs”Configured per use: sku.
Outputs
Section titled “Outputs”foundin_stockstock_statusavailabilitystock_quantityskunamepricepermalinkcategoriesdescriptiondescription_truncatederror
Requires
Section titled “Requires”the woocommerce integration
Auto-generated from the skill registry (load_skills()). Do not edit by hand.