visualAIAPI Docs

Claude commerce agents

discovergpt-storefront-backend is an open-source Python package that implements Anthropic's StorefrontBackend interface on top of discoverGPT's REST API — plug your catalog into any Claude-built shopping agent with no custom integration code.

discovergpt-storefront-backend is an open-source Python package that implements Anthropic's StorefrontBackend interface — the storefront adapter contract from Anthropic's commerce-agents blueprint for building Claude-powered shopping agents. Point it at your discoverGPT credentials and any agent built against that interface (Anthropic's reference shopping agent, or your own) can search your catalog, inspect product detail, manage a cart, hand off to checkout, and answer store-policy questions — against your real, live discoverGPT data, with no bespoke glue code.

Why this exists

Anthropic's StorefrontBackend is a plain Python interface: implement it once against your commerce backend, and every agent built on their shopping-agent-sdk gets a working storefront for free. discovergpt-storefront-backend is that implementation for discoverGPT merchants — it maps the interface's methods onto the same /v1 REST endpoints documented in Gateway API, using the same client-credentials auth as everything else on this site.

Install

pip install git+https://github.com/vairetail/discovergpt-storefront-backend

Quickstart

from discovergpt_storefront_backend import DiscoverGPTBackend

backend = DiscoverGPTBackend(
    base_url="https://api.vairetail.com",
    client_id="YOUR_CLIENT_ID",
    client_secret="YOUR_CLIENT_SECRET",
    merchant_id="YOUR_MERCHANT_ID",
)

# Use directly...
results = await backend.search_products(session, query="linen shirt for a summer wedding")

# ...or hand it to Anthropic's shopping-agent-sdk, which drives it through
# every StorefrontBackend method as the agent shops.

A full runnable example — wiring the backend into Anthropic's reference shopping agent and driving a multi-turn shopping conversation from the terminal — ships in the repo at examples/run_shopping_agent.py.

What's implemented

DiscoverGPTBackend backs these StorefrontBackend methods with real discoverGPT data:

MethodBacked by
search_productsPOST /v1/search — trimodal (text/color/image) product search
get_product_detailsGET /v1/product/{product_id}
get_cart / add_to_cart / update_cart_item / remove_from_cartPOST /v1/cart/add plus an in-process, session-local cart (see below)
checkout_handoffResolves the cart's line items to real Shopify variant ids and hands off to your storefront's checkout
search_policiesPOST /v1/policies/search — shipping, returns, privacy, terms, subscription

Cart state is session-local, not persisted server-side: it lives in the DiscoverGPTBackend instance for the life of the shopping session, matching how Anthropic's reference agent expects a lightweight backend to behave. If you need a durable, cross-device cart, sync it to your own storage in the agent layer.

Methods with no discoverGPT equivalent yet — get_orders, get_order, get_fulfillment_options, and get_preferences — return the interface's own NotOffered signal rather than a fake or empty result, so an agent handles the gap explicitly instead of silently getting wrong data. Each is a documented override point: implement it against your own order/fulfillment system and pass it in.

available: false is not an error

search_policies returns available: false (never a 4xx/5xx) when the merchant has no usable Shopify Admin token on file — the expected case for a pure discoverGPT / BYO-catalog install without a connected Shopify store, not a failure.

Is this an MCP tool?

No — discovergpt-storefront-backend's value is entirely at the Python interface level: it's an adapter you install into a Claude agent's process, not an MCP server you connect to. Most of what it wraps also has an MCP equivalent (search_products_trimodal, get_product_details, add_to_cart), but search_policies is REST-only today — POST /v1/policies/search, not one of the 40 MCP tools. If your agent runtime already speaks MCP, use the MCP transport for catalog/search tools directly; use this package when you're building or extending a Claude commerce agent against Anthropic's StorefrontBackend interface itself.

Next steps

On this page