webmcp-ai.dev Get the audit →

home / cookbook

WebMCP tool patterns: what to expose, by industry

A practical cookbook of WebMCP tool patterns — the specific tools an e-commerce store, restaurant, SaaS, local service business, or publisher should register with document.modelContext, with code and schema examples.

Updated 2026-08-28 · webmcp-ai.dev research desk

The hard part of WebMCP isn't the API — registerTool() takes minutes. The hard part is tool design: choosing which capabilities to expose, naming them so an LLM knows when to call them, and drawing the line between read-only tools, action tools, and sensitive tools. This cookbook collects the patterns we use in our audits, organized by business type.

Three rules before you register anything

  1. Expose tasks, not UI. An agent doesn't need click_next_button; it needs search_products. Wrap outcomes your visitors want, not the widgets that deliver them.
  2. Mark read-only tools. Set annotations: { readOnlyHint: true } on anything that only fetches. Browsers and agents treat these with less friction.
  3. Keep sensitive actions confirmable. Checkout, payments, cancellations: return a confirmation step in your tool result rather than completing irreversible actions in one call. The human stays in the loop by design.

E-commerce stores

ToolTypeWhy agents need it
search_productsread-onlyThe single highest-value tool on any store — agents shop by query, not by browsing category pages.
get_product_detailsread-onlyPrice, variants, stock, shipping options for a specific item.
add_to_cartactionPuts the item in the user's real session cart — the user completes checkout.
check_return_policyread-onlyAgents verify policies before recommending a purchase.
get_order_statusread-only (auth'd)"Where's my order?" without a support ticket.
document.modelContext.registerTool({
  name: "add_to_cart",
  description: "Add a product to the shopping cart. Use after confirming the product and variant with the user.",
  inputSchema: {
    type: "object",
    properties: {
      productId: { type: "string" },
      variantId: { type: "string" },
      quantity: { type: "number", default: 1 }
    },
    required: ["productId"]
  },
  async execute({ productId, variantId, quantity = 1 }) {
    const cart = await window.store.addToCart(productId, variantId, quantity);
    return { success: true, cartTotal: cart.total, itemCount: cart.items.length,
             checkoutUrl: "/checkout" };
  }
});

Restaurants, salons & booking businesses

Booking forms are also the perfect fit for WebMCP's declarative API — annotate your existing reservation form with tool attributes and it becomes an agent tool with no JavaScript at all (this is exactly what Chrome's "Le Petit Bistro" demo does).

SaaS products

Local service businesses

Publishers & content sites

Anti-patterns we see in audits

Want this designed for your specific site? The deep audit ships a custom tool blueprint — names, LLM-ready descriptions, JSON schemas, and wiring notes matched to your actual pages. Platform-specific how-tos: Shopify, WordPress, Next.js.