mintpaw-webmcp

AIoOS-67/mintpaw-webmcp Checked 2 days ago

The Shopify store that tells the agent no.

A working Shopify storefront selling smart pet devices, with a WebMCP layer whose main job is to stop the wrong purchase. Smart pet gadgets get returned at a punishing rate, and mostly not because they are broken. They are returned because of mismatches that a spec table buries on line seven: Every one of these is knowable before checkout. None of them is *noticeable* while scrolling a product page. A shopper skims past all four. An agent with comparable fields catches all four before the money moves.

Summary extracted from the README.

MintPaw — the store that tells the agent no

Live: https://mintpaw.tech · License: MIT · Built for the WebMCP Challenge

A working Shopify storefront selling smart pet devices, with a WebMCP layer whose main job is to stop the wrong purchase.


The problem this is actually about

Smart pet gadgets get returned at a punishing rate, and mostly not because they are broken. They are returned because of mismatches that a spec table buries on line seven:

  • a 2.4GHz-only device meeting a 5GHz-only mesh router — it will never finish setup
  • a 4G tracker on LTE bands that do not exist in the buyer's country
  • a companion app not published in the buyer's region
  • a single-cat litter box arriving in a two-cat home

Every one of these is knowable before checkout. None of them is noticeable while scrolling a product page. A shopper skims past all four. An agent with comparable fields catches all four before the money moves.

So MintPaw's agent layer is not a faster way to buy. It is a gate.


What we did not build, and why that matters

Shopify's storefront now injects its own WebMCP adapter automatically — cdn.shopify.com/storefront/webmcp/webmcp-0.1.1.js. Out of the box, mintpaw.tech already exposes:

search_catalog · get_product · get_cart · update_cart · cancel_cart · proceed_to_checkout · search_shop_policies_and_faqs

Search, cart and checkout are solved by the platform. An earlier draft of this project re-implemented five of them and collided with get_product outright — two tools with one name, and an agent picking between them at random. That draft is deleted.

The interesting question WebMCP raises for a merchant is not "how do I expose my storefront?" — the platform now does that. It is "what do I know that the platform cannot?"

For MintPaw the answer is compatibility: which device works in this home, for this animal, and which of the manufacturer's claims we have not actually verified. That knowledge exists nowhere in Shopify's data model. Everything in this repo is that layer.


Why cross-border sourcing makes this necessary

Every product here is sourced on Alibaba.com and shipped to a buyer in another country. That is not incidental — it is the reason the gate has to exist. Cross-border sourcing produces a specific class of failure a domestic store never sees:

Sourced fact What it means for the buyer
Feeder lists plug variants for 8 countries, input voltage not stated A plug adapter changes the pins, not the voltage. A 220–240V unit on 120V US mains burns out on first use.
Tracker lists LTE 850/900/1800/1900 MHz, no band numbers, no 700MHz US carriers lean on 700MHz for rural and in-building coverage. It may show bars on a city street and nothing in a basement.
Tuya app, regions not stated The companion app is published per app-store region. No app, no setup.
"Waterproof" with no IP rating A word, not a specification.

None of this appears on a product page. All of it is answerable before checkout — if the store is willing to say what it actually knows.

Provenance, not just "unverified"

Every field in theme/assets/mintpaw-compat.js carries where its value came from, and the verdict engine reads it:

confirmed supplier's written specification or a verifiable document
platform_listed listed in the Alibaba.com product detail
inferred_tbc a conservative inference from the page — a hint, not a fact
pending no source at all; the supplier has to be asked

Not one field in this catalogue is confirmed. No supplier has returned written specifications. The store says so, on the page, next to the price.

An earlier version of this data asserted that four products were 2.4GHz-only and that the litter box had a multi-cat limit. Re-checking the Alibaba listings showed both were guesses. They were removed, which made the demo less dramatic and the store more honest — and the tests were rewritten to assert the honest behaviour instead.

The open questions we have put to each supplier and not had answered are published on the product page too, under "What we have asked the supplier, and not yet been told".

Sourcing research was done with Alibaba Accio Work.

The tools

Five are always present. Two do not exist until a household profile does — without one they cannot answer honestly, so they are withdrawn rather than left to guess.

Tool What it does
set_household_profile always Records species, weight, how many animals share the device, the Wi-Fi bands the router actually broadcasts, country, willingness to add a cellular plan. Persists across pages.
get_household_profile always Reads it back — the shopper may have edited or cleared it by hand.
clear_household_profile always Erases it, and withdraws the gated tools.
check_compatibility always The core. Per product: ok / caution / unknown / blocked, with the specific reason in plain language.
explain_product_fit always One product in depth — plus every manufacturer claim MintPaw has not verified.
find_compatible_alternative gated What works instead. Returning "nothing here suits you" is a correct answer.
add_compatible_to_cart gated Re-checks, then refuses anything blocked. Holds caution/unknown items until the shopper has genuinely been told why.

The refusal is the product

// add_compatible_to_cart({ handle: "app-control-smart-automatic-self-cleaning-cat-litter-box" })
{
  "added": false,
  "refused": true,
  "verdict": "blocked",
  "reasons": ["Built for a cat. You have a dog."],
  "tellTheShopper": "This will not work in their home and MintPaw will not put it
     in the cart. Give them the reason above in plain words."
}

acknowledged_caveats: true lets an agent proceed past a caveat once the shopper has heard it. It does not override a hard block — that is asserted in the test suite.

Admitting what we don't know

The product data comes from Alibaba sourcing documents full of unconfirmed manufacturer claims. Rather than launder those into spec, every tool carries them separately:

"notYetVerifiedByMintPaw": [
  "Battery capacity — the listing says 10000mAh, MintPaw has not measured it",
  "2K resolution claim",
  "What the 'AI detection' actually detects"
]

A blocked verdict and an unknown verdict are deliberately different values. "We don't know" is not "it's fine", and the tool descriptions instruct the agent to pass that distinction on rather than smoothing it into a recommendation.


People and agents on the same object

WebMCP's trust model assumes a human is watching. A silent background mutation breaks it.

So every call renders into a panel in the corner of the storefront: the current household profile, the live verdict counts, what is blocked and why, and a running log of the last tool calls. The shopper can clear the profile there by hand — the agent and the person are editing the same object, and both can see the other do it.

That is also why add_compatible_to_cart opens the cart drawer. The agent's work has to happen in front of you.


One source of truth for the shopper and the agent

Every product arrived with no description at all. The supplier gave us specification fragments, not marketing copy — and writing confident prose around numbers we have not verified is the exact thing this store exists to avoid.

So the product copy is rendered from MINTPAW_COMPAT: the same record, the same fields, in the same order that check_compatibility reads. A shopper and an agent cannot be told different things about a product, because there is only one source for both. It also puts the unverified claims on the page, under a heading that reads "What we haven't checked ourselves", rather than only inside a tool response the shopper will never see.

If the merchant later writes a real description, the generated copy stands aside.

Running it

node tests/run-tools.mjs          # 33 assertions against the real catalogue
node tests/run-tools.mjs --live   # ...fetched live from mintpaw.tech

The suite stands up enough of document/window to load the real theme asset, then calls the tools the way an agent would. It asserts the things that would make the store a lie if they broke — chiefly that a 2.4GHz device is never ok in a 5GHz-only home, and that a hard block cannot be acknowledged away.

For a browser without the store, mock/index.html is a local Shopify simulator with an interactive harness.

Installing into the theme

theme/assets/mintpaw-webmcp.js     the tools
theme/assets/mintpaw-webmcp.css    the panel
theme/assets/mintpaw-compat.js     the compatibility data
theme/snippets/mintpaw-webmcp.liquid

Render the snippet once before </body> in layout/theme.liquid:

{%- render 'mintpaw-webmcp' -%}

Shopify handles the WebMCP origin trial itself, so no token registration is needed.

Compatibility data. It ships as a static asset so it is reviewable in this repo and needs no admin data entry. The production path is Shopify metafields under the mintpaw namespace — the schema is in docs/METAFIELDS.md, and the snippet carries a Liquid block that renders those metafields into the identical shape. Flip MINTPAW_USE_METAFIELDS and nothing else changes.


Known limitations

Stated plainly, because a store whose whole pitch is honesty should not hide these.

  • Our gate can be bypassed. Shopify's built-in update_cart will happily add a blocked product; we cannot unregister a platform tool. What we can do is describe ours as the one that knows about this shopper's router, and make any bypass visible in the panel. A real fix needs a way for a merchant to constrain platform-provided tools — worth raising with the spec.
  • Compatibility data is only as good as the sourcing. Several fields are genuinely empty because the supplier has not confirmed them. That produces unknown verdicts, which is the honest output, not a bug.
  • Weight ranges are unset for every product. We would rather return "the supported weight range is not confirmed" than invent a plausible number.

Licence

MIT — see LICENSE.


Screenshots

blocked Dog owner, 5GHz-only router. Two rows red, Add to cart dead and relabelled, express checkout gone.
caution Two cats with 2.4GHz available. Caveats instead of a block, buy buttons restored.
copy Product copy generated from the record the agent reads, unverified claims included.
asked The questions put to the supplier and not yet answered, published on the product page.
voltage The cross-border trap: eight plug variants, one unconfirmed voltage.