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.
Natural language agent
Describe what you want in plain English. Gemini decides which WebMCP tools to call and runs them against live ShopMate data.
Registered tools
search_productsSearch 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_productsFilter 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_productsCompare 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_cartAdd 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_cartRemove a product from the ShopMate cart by product id. Returns whether the item was present and the resulting cart totals.
productId: string
update_quantityChange 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_cartReturn the current cart contents, line totals, item count, currency, budget, remaining budget, and budget status (under, near, over, or no_budget).
no input
optimize_cartOptimize 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.