WebMCP storefront tools

The page tools the SureBright SDK registers on your storefront for browser agents: what each tool returns, how a plan is added to the cart, and how to switch it on.

Early access. Ask your SureBright contact to enable this for your store.

WebMCP lets a web page offer tools to an AI agent running in the shopper's browser, through document.modelContext. When WebMCP is switched on for your store, the SureBright SDK that already renders your widget registers three tools: two that read protection options and one that adds a chosen plan to the cart. An agent shopping on your storefront can then offer SureBright protection the same way the widget does, with the same quotes, the same cart lines and the same attribution to your store.

There is nothing to install. The tools ship inside the SDK; SureBright turns them on per store. They are off by default.

Where the tools appear#

The tools follow your widget's own offering, so an agent never sees a plan the widget would not show.

ToolRegistered when
get_product_protection_optionsProduct protection is on for your store, or the page is a post-purchase page
get_shipping_protection_optionsShipping protection is on for your store
add_protection_to_cartEither of the above

The SDK registers the tools at page load and keeps trying for ten seconds, because the page's WebMCP support can arrive after the SDK does. On Shopify, Shopify's own WebMCP tools (search, product, cart) run alongside SureBright's. The SDK recognises a cart write made by Shopify's agent tools and does not treat it as the shopper's own, so the widget does not fight the agent.

Today the tools are called by browser agents that implement the WebMCP draft, which Chrome ships as an origin trial on Shopify storefronts. Which assistants actually use page tools changes quickly; expect few calls while the standard settles.

Tools#

get_product_protection_options#

Read-only. Quotes SureBright plans for one product through the widget's own quote path. Pass product_handle and variant_id for a product, a cart item's variant_id alone, or nothing for the product page's current variant. On a post-purchase page with no input it lists the order's items.

Reply fieldMeaning
statusok, not_eligible or temporarily_unavailable
productThe product title
plansOne entry per plan: plan_id, term_years, price, currency. Prices are per unit in the shopper's currency; with 2 units in the cart the plan adds 2 × price.
is_bundle, coversFor a bundle product, one plan covers the whole bundle; covers lists the components.
coverage_summaryUp to six lines of what the plan covers
terms_urlA link to the plan's terms
noteA reminder to the agent that the plan is optional and is added only if the shopper chooses it

get_shipping_protection_options#

Read-only. Returns the one shipping protection plan for the current cart, which covers the whole order against loss, theft and damage in transit. Takes no input.

Reply fieldMeaning
statusok, not_eligible, declined, cart_empty or temporarily_unavailable
plan_id, price, currencyThe plan to add and what it costs, in USD
coversThe cart items the plan protects
coverage_summaryUp to six lines of what the plan covers
is_in_cartWhether shipping protection is already in the cart
reasonWhen declined: cart_value_over_limit, no_eligible_items or not_offered_for_this_cart

The price follows the cart. An agent should call this again after the cart changes.

add_protection_to_cart#

Consequential. Adds a plan the shopper chose, by a plan_id from one of the two reading tools. A product plan needs its product in the cart first and covers each unit of it; on a post-purchase page it covers the units bought. Adding a different term for a product that already has a plan replaces the existing plan and says so. Shipping protection is one plan for the order; if the cart changed since it was quoted, nothing is added and the new plan comes back to confirm.

statusMeaning
addedThe plan is in the cart. The reply gives quantity, plan_total and currency.
already_presentThe same plan was already in the cart.
replacedA different plan for the product was swapped out; replaced_plan describes it so the agent can tell the shopper.
product_not_in_cartAdd the product first, then call again with the same plan_id.
price_changed, coverage_changedShipping only: the cart changed, so the plan did. Confirm the new price and covers with the shopper, then call again with the returned plan_id.
unknown_planThe plan_id is not from a current quote. Call the reading tool again.
invalid_inputplan_id is missing or not a string.
not_eligibleThe plan can no longer be offered.
remove_unconfirmedThe new plan is in the cart but the previous one may still be there.
failedThe cart write did not land; reason says why. cart_busy means the shopper's own cart update is in flight; try again shortly.
cancelledThe agent aborted the call.
temporarily_unavailableThe quote service did not answer.

Adds run one at a time, so two agent calls cannot race each other or the shopper's own cart changes.

What the shopper sees#

A plan added by an agent is a normal SureBright line in the cart, priced and labelled as the widget would price and label it, and it checks out like any other. The SDK records the add with the source WebMCP, so it can be told apart from a plan the shopper added through the widget.

When Shopify's own agent tools add a product to the cart on a product page and the product has no plan yet, the SDK offers the shopper a plan in the widget's coverage modal once the add has landed, one product at a time, and never over an offer the shopper opened themselves. The shopper decides as usual.

Switching it on#

Ask your SureBright contact to enable WebMCP for your store. No theme or checkout change is needed. To check it is on, open your storefront in a browser that supports WebMCP with the SDK's debug logging on: the SDK logs Tools registered with the three tool names when the flag is on, and WebMCP disabled for this store when it is off.