---
title: WebMCP storefront tools
slug: configured-commerce/docs/webmcp-storefront-tools
createdAt: 2026-10-21T16:26:54.000Z
---

WebMCP storefront tools in Optimizely Configured Commerce make your Spire storefront readable by AI agents. An agent works inside the buyer's own signed-in session. It reads the session context, searches your catalog at that account's prices, and builds the cart on the buyer's behalf. A reorder that takes 20 clicks becomes a single instruction.

Every action runs through the same business logic as the on-screen storefront. Contract pricing, promotions, entitlements, and validation apply exactly as they do on the site. The cart the agent builds and the cart the buyer sees are always the same cart.

## Prerequisites

Confirm the following before you enable the tools:

- Configured Commerce `5.2.2608.613+sts` or later.
- Administrator access to the Admin Console.
- A browser that supports WebMCP.

## Enable WebMCP storefront tools

Turn the tools on for each website that you want browser agents to reach. No storefront configuration and no custom code are required.

To enable the tools, complete the following steps:

1. Go to **Administration > Settings > Site Configurations > General** in the Admin Console.
2. Set **Enable Web MCP Tools** to **On**.

The setting applies to one website. Repeat the steps for each website that needs the tools. The tools then register on the Spire storefront automatically when the storefront loads.

## Browser requirements

The storefront registers its tools only when the browser accepts them. Confirm the following before you test:

- **Secure context** – WebMCP requires HTTPS or `localhost`. The tools do not register on an insecure connection.
- **Model context support** – The browser must support `navigator.modelContext`. Chrome supports it natively behind an experimental flag or the origin trial. The polyfill Configured Commerce includes covers other browsers.
- **Permitted frame** – The tools do not register inside an iframe that does not permit the WebMCP tools feature.

The storefront guards registration. On an unsupported browser, an insecure connection, or a restricted frame, no tools register. The storefront behaves normally and no errors display to the buyer.

## WebMCP storefront tools

An administrator enables the setting and the buyer opens the storefront in a supported browser. The following tools then become available to the agent. The agent calls them inside the buyer's own signed-in session. It sees only what that account is permitted to see.

Product and cart line parameters are identifiers, not product numbers. The agent resolves them from a search result or from the current cart.

### Read

Read tools give the agent context before it changes anything. They identify the buyer, return the current cart, and search the catalog at that account's prices.

:::ExpandableHeading
### `commerce_getContext`

Returns the session context: the signed-in user, bill-to and ship-to addresses, website, language, currency, and fulfillment method. A pick-up warehouse returns when the fulfillment method is pick up.

- **When to use**
  - Identify the signed-in user before a search or a cart change.
  - Confirm which bill-to and ship-to the session uses.
  - Determine the website, language, and currency that prices return in.
  - Check whether the session is set to delivery or pickup.
- **Parameters**
  - None.
- **Example prompts**
  - *Show me which account I am signed in to.*
  - *Tell me whether this session is set to delivery or pickup.*
:::

:::ExpandableHeading
### `commerce_getCart`

Returns the current cart, including line items, totals, and checkout eligibility.

- **When to use**
  - Review the cart before changing it.
  - Confirm totals after the agent adds or updates lines.
  - Check whether the cart is eligible for checkout.
- **Parameters**
  - None.
- **Example prompts**
  - *List what is in my cart.*
  - *Read back my cart with the line totals.*
:::

:::ExpandableHeading
### `commerce_searchProducts`

Searches the catalog and returns matching products with the account's own real-time price and inventory availability.

- **When to use**
  - Find products by name, description, or keyword.
  - Locate an item when the buyer does not know the product number.
  - Page through a large result set.
- **Parameters**
  - `query` – The search text.
  - `page` – (Optional) The results page to return. Defaults to 1.
  - `pageSize` – (Optional) The number of results per page. Defaults to 16, maximum 50.
- **Example prompts**
  - *Find nitrile gloves in a large size.*
  - *Search for copper fittings and show my price.*
:::

:::ExpandableHeading
### `commerce_getProduct`

Returns product detail with the account's own real-time pricing and inventory availability.

- **When to use**
  - Confirm price and availability before a cart change.
  - Retrieve full detail for a product that a search returned.
- **Parameters**
  - `productId` – The identifier of the product.
- **Example prompts**
  - *Show my price for the gloves you just found.*
  - *Check whether that item is in stock for my account.*
:::

### Write

Write tools build the cart. Each one runs the same pricing and validation the storefront applies when a buyer clicks.

:::ExpandableHeading
### `commerce_addToCart`

Adds a product to the current cart.

- **When to use**
  - Add an item the buyer named or that a search returned.
  - Build a multi-line order from a list the buyer dictates.
  - Reorder a routine set of items in one instruction.
- **Parameters**
  - `productId` – The identifier of the product.
  - `qty` – The quantity to add.
  - `unitOfMeasure` – The unit of measure. The product default applies when this is omitted. The agent supplies the unit of measure code, its display value, or its description.
- **Example prompts**
  - *Add 12 of those to my cart.*
  - *Add two cases of my usual filters.*
:::

:::ExpandableHeading
### `commerce_updateCartLine`

Updates the quantity of a cart line.

- **When to use**
  - Correct a quantity without removing and re-adding the line.
  - Scale an order up or down before the buyer reviews it.
- **Parameters**
  - `cartLineId` – The identifier of the cart line to update.
  - `qty` – The new quantity. A quantity of `0` removes the cart line.
- **Example prompts**
  - *Change the gloves to six boxes.*
  - *Make the second line 24 instead of 12.*
:::

:::ExpandableHeading
### `commerce_removeCartLine`

Removes a line from the current cart.

- **When to use**
  - Drop an item the buyer decided against.
  - Clear an incorrect line before the buyer checks out.
- **Parameters**
  - `cartLineId` – The identifier of the cart line to remove.
- **Example prompts**
  - *Remove the copper fittings from my cart.*
  - *Take the last item off my order.*
:::

After a write, the agent calls `commerce_getCart` to read the refreshed cart. The storefront updates live, so the buyer does not need to refresh the page.

When a product fails validation, the tool returns a readable reason. Examples include a discontinued product, a product the account is not permitted to order, and a product with no price.

Cart tools do not run while the site is in maintenance mode.

## What agents cannot do

Checkout, order submission, quote submission, and approvals stay with the buyer. An agent assembles the cart. The buyer commits the order.

Irreversible financial actions require an authorization and confirmation model. That model is not part of this release.

## Verify the tools

Validate the tools against a business-to-business (B2B) account that has contract pricing. This confirms that the prices an agent returns match your storefront.

Use one of the following:

- **Model Context Tool Inspector** – Serve the storefront over HTTPS or `localhost` and enable WebMCP in Chrome. Install the inspector extension and sign in as a test account. Confirm that all seven tools display with names, descriptions, and input schemas. Run each tool directly from the inspector.
- **Gemini in Chrome** – As of September 2026, this is the only mainstream agent that consumes WebMCP tools natively. Give it a task such as *find product X and add two to my cart*. Confirm that it completes the task.
- **External agent with a browser bridge** – An external agent reaches the tools through a browser bridge that drives its own Chrome instance. Use this until agents ship native support.

Confirm the following:

- All seven tools display with the correct names and input schemas.
- `commerce_getContext` returns the signed-in account, bill-to and ship-to, currency, and language that match the session.
- Prices from `commerce_searchProducts` match what the storefront shows for that same account.
- `commerce_getCart` matches the on-screen cart.
- `commerce_addToCart` updates the mini-cart and the cart page live, with no manual refresh.
- `commerce_updateCartLine` and `commerce_removeCartLine` reach the storefront and totals recalculate.
- An invalid quantity or a restricted product returns a clear message and the page does not crash.
- On an unsupported browser or an insecure connection, nothing registers and no errors display.

## Availability and browser support

WebMCP is a W3C draft standard. Buyers reach the storefront tools through an agent in their own browser. Adoption therefore depends on browser and agent support, not on your implementation. Buyers have nothing to turn on and nothing to click in the storefront.

Enabling the setting makes your storefront agent-ready before that support becomes widespread. No further work is required when browser agents become generally available.
