Status, 23 November 2026: accepted by Yevhen Kariakin. The founder's acceptance is not recorded here. Implemented in the module contract and in both OpenCart modules (1.9.0; the filter was renamed from categorySubtree to categorySubtreeId the same day by Artem Belikov, so that it reads as an id like categoryId and parentId, modules 1.9.1); the API side is being built on the same branch. Nothing of it has run on a test shop or a real store yet.
012 — Finding a kind of product
"All phones" is answered by the tools, not by a rule the model has to remember: a word search also reports the categories whose name matches, a product search by category includes its subcategories, and one tool finds a kind of product in one call. The module contract gets an optional filter for the products of a category and everything under it.
Context
Both agents were told in their instructions to find a kind of product through its category first, then list that category's products. The model does not always do it: on 23 November 2026 the Store Assistant answered "can you find all phones?" with one product (the word "phone" matches "iPhone", not "HTC Touch HD"). Two more gaps sat under it:
- the product search by category returned the products of that category only, not of its subcategories, so a shop with "Phones → Smartphones, Feature phones" showed an empty parent category;
- the shopper agent's own tool description said that subcategories were included, while the contract and both modules did not include them.
Decision
- A word search reports matching categories. When the agent searches products by words of the name and gives no category, the answer also lists up to five categories whose name matches the same words (
matching_categories). The API asks the module's existing category query; nothing new is needed from a module. - A product search by category includes the subcategories, at any depth, each product once. The Store Assistant's tool can ask for the category alone. The answer says whether the subcategories were included (
subcategories_included). - One tool for a kind of product for each agent (
catalog_find_by_kind,storefront_find_by_kind): it finds the categories that match the words, returns their products with subcategories, and falls back to a word search on product names, saying which way it found them. - The module contract gets the optional filter
categorySubtreeIdonproduct.queryandstorefront.product.query(contracts/module/operations.json,rules.category_subtree): the products of the category and of every category under it. On the admin side every category counts whatever its status; on the storefront only the categories the storefront shows, and a hidden category hides what is under it. A module declares the filter only when it answers it in one query in the shop's database; Store Deputy sends it only to a module that declared it, and otherwise finds the subcategories itself or says that they were not included. - The agents' instructions point to these tools; they no longer carry the rule alone.
Why this scales to other platforms
Items 1 to 3 are built in the API from operations every module already has (category query by name, product query by category), so a WooCommerce or PrestaShop module gets them without new work. Item 4 is optional, like other query filters: a module without it still works, only slower or with a note to the agent. The platforms keep the hierarchy in a form that answers it in one query, as far as the author knows them (the vendors' documentation was not re-read for this page): OpenCart keeps each category's whole path (category_path), WooCommerce's product query by category includes child categories (tax_query with include_children), PrestaShop keeps a nested set (nleft/nright), Magento keeps each category's path. Magento's "anchor" setting is per category and must not decide the answer: a Magento module returns the descendants explicitly.
Alternatives considered
- Keep the rule in the instructions only. It failed in practice; a tool behaves the same every time.
- Change
categoryIdto include subcategories. It would change the meaning of an accepted filter under the modules already installed; a new optional filter keeps old modules correct. - Walk the category tree in the API for every module. Works everywhere, but costs one request per subcategory; it stays the fallback, not the main path.
Scope
The module contract, both OpenCart modules (1.9.0), the API's catalog and shopper tools, the two new tools, the tools contract (contracts/mcp/tools.yaml) and both agents' instructions. Checked so far: the contract check. Not yet run on a test shop or a real store.