WebMCP

ShopMate registers eight tools on document.modelContext so a browser-side AI agent can search, compare and manage the cart with the exact logic the UI uses. Everything below is live: running a tool here changes the real application state.

Detecting browser support…
0 of 8 tools registered

Natural language agent

Describe what you want in plain English. Gemini decides which WebMCP tools to call and runs them against live ShopMate data.

Idle — enter a request and press Run Agent.

Registered tools

search_products
read-only

Search the ShopMate product catalog by text query and optional category. Returns matching products with id, name, price, rating, availability and tags. The catalog page visibly updates to show the same results.

query: string (required), category?: string, limit?: number

filter_products
read-only

Filter products by maximum price, minimum rating, category, and availability. Applies the same filters to the visible catalog page so the human sees exactly what the agent sees.

maxPrice?: number, minRating?: number, category?: string, availableOnly?: boolean

compare_products
read-only

Compare selected products by price, rating, category, tags, and value-for-money (rating per dollar). Highlights the cheapest, highest rated, and best value option and fills the comparison tray in the UI.

productIds: string[] (min 2)

add_to_cart
writes state

Add a product to the ShopMate cart by product id and quantity. Rejects unknown ids and out-of-stock products. The cart page and header counter update immediately.

productId: string, quantity: number (1-99)

remove_from_cart
writes state
destructive

Remove a product from the ShopMate cart by product id. Returns whether the item was present and the resulting cart totals.

productId: string

update_quantity
writes state

Change the quantity of a product in the ShopMate cart. Setting a quantity of 0 removes the line entirely.

productId: string, quantity: number (0-99)

get_cart
read-only

Return the current cart contents, line totals, item count, currency, budget, remaining budget, and budget status (under, near, over, or no_budget).

no input

optimize_cart
writes state
destructive

Optimize the cart against a target budget while preserving useful quality and category coverage. Swaps expensive lines for cheaper same-category alternatives, reduces quantities, then drops the worst value items only as a last resort. Applies the changes to the live cart.

budget: number (> 0)

Playground

Call search_products with JSON arguments. Input is validated with the same Zod schema the agent path uses.

Activity timeline

No tool calls yet. Run a tool above or ask the assistant to shop for you.