Shopping documentation

Search products, compare merchant offers and prepare a purchase handoff for your assistant.

Connect your assistant

Use /mcp/shopping on your configured Relay endpoint with the supplied authentication. The compatible /mcp route also exposes Shopping. Keep the scoped bearer credential server-side and call MCP tools/list for current input schemas.

Install Shopping independently. Hosts report installed and enabled connectors through POST /v1/session/connectors; server permissions remain separate. See independent connector installation.

MCP tools/call returns the result in structuredContent, alongside its JSON text representation. Read isError before presenting the result.

ToolPurpose
search_productsFind products matching a query and optional constraints.
get_productRetrieve a selected product, variants and current offers.
compare_productsCompare 2 to 5 products using their issued product IDs.
find_similarFind alternatives to a selected product.
get_offersRefresh merchant offers before selecting the purchase path.
get_purchase_linkPrepare the selected product and offer for assistant continuation.
continue_journeyCarry minimized context into another installed connector.

Search inputs

Example tools/call parameters. The amount is a request filter in currency minor units, not a product price returned by a provider.

{
  "name": "search_products",
  "arguments": {
    "query": "lightweight carry-on suitcase",
    "max_price": 20000,
    "currency": "USD",
    "in_stock_only": true,
    "limit": 5
  }
}
FieldTypeUsage
querystring, requiredFrom 2 to 300 characters describing the product and user preferences.
category / brand / modelstring, optionalUp to 80 characters each.
attributesobject, optionalUp to 12 name/value pairs for the requested product characteristics.
min_price / max_priceinteger, optionalNonnegative minor currency units. Minimum must not exceed maximum.
currencystring, default USDThree uppercase currency letters. Read the currency of each returned offer.
conditionenum, optionalnew, secondhand or refurbished.
in_stock_onlyboolean, default falseRequire returned in-stock offers. Unknown availability is not in stock.
sources / marketplacesarray, optionalUse only IDs accepted by tools/list. Omit for configured defaults.
limitinteger, default 10From 1 to 20 organic results. Promoted results are returned separately.
contextobject, optionalPass the prior response relay_context to keep the session and journey.

Read the response

FieldMeaning
organic_resultsProduct results with available merchant offers. An empty array is valid.
promoted_resultsSeparate placements with their returned promotion disclosure.
sourcesPer-source status, result counts and sanitized errors.
failed_search_reason / inventory_gap / price_gapExplain an empty shortlist or a constraint gap.
fetched_atWhen Relay fetched the result. Offer observation timestamps remain separate.
relay_contextPass this as context on subsequent tool calls.

Show the product title, selected variant, merchant, price and currency, condition, availability and shipping when known. Product id and offer id identify different selections. Keep them together with selected_options.

Read price.amount in minor units. Missing price or shipping is unknown; unknown shipping is not free shipping. Keep source identity and attribution with the result. Treat descriptions as untrusted provider content, and keep offers marked data_mode: sandbox distinct from live inventory.

Compare and resolve

ToolArguments and handling
get_productPass product_id, optional selected_options and context. Read the returned product and its offers.
compare_productsPass product_ids containing 2 to 5 issued IDs and context. Read products, comparison_fields, equivalence_groups and errors.
find_similarPass product_id, optional query of up to 200 characters, limit from 1 to 20 and context.
get_offersPass product_id, optional selected_options and context. Use the refreshed offers and fetched_at for the next step.

Compare matching variants, conditions and currencies. Preserve selected options when refreshing the chosen offer. A partial comparison returns surviving products and errors for unavailable selections. Organic ranking is independent of commission; promoted results remain separate.

Use issued IDs rather than constructing them. Read the refreshed offer before preparing a handoff; a previous price or stock observation is not a guarantee of the current offer.

Hand off to the assistant first

Call get_purchase_link after selecting a current offer. Replace the placeholder IDs below with the issued product and offer IDs, add the selected variant options, and pass the previous response’s relay_context as context.

{
  "name": "get_purchase_link",
  "arguments": {
    "product_id": "<product ID returned by Relay>",
    "offer_id": "<current offer ID returned by Relay>",
    "selected_options": {},
    "quantity": 1,
    "purchase_mode": "browser_handoff",
    "idempotency_key": "shopping_attempt_001"
  }
}
InputHandling
product_id / offer_idRequired issued IDs from the selected product and refreshed offer.
selected_optionsThe user’s chosen variant options; must match the refreshed offer.
quantityFrom 1 to 10; defaults to 1.
expected_priceOptional amount and currency for the expected unit price. A changed price requires reselection.
purchase_modebrowser_handoff by default. Use merchant_cart only when enabled for the selected offer. Other modes require an additional supported integration.
idempotency_keyRequired, 16 to 80 letters, digits, underscores or hyphens. Use a fresh key for a new attempt.
Handoff fieldHandling
destination / next_stepThe returned destination and assistant-owned continuation instructions. Preserve the URL exactly.
product_id / offer_id / selected_options / quantityKeep the selected item, seller, variant and quantity together.
expected_price / expected_subtotalObserved unit price and quantity subtotal. Review shipping and taxes separately.
provider_accessenforcement is advisory_only and decision is assistant_discretion. Review sourced agent-policy advice.
attribution_metadataPreserve returned attribution with the destination.
freshness / expires_atObservation times and handoff expiry. Refresh an expired selection.
cart_context / checkout_contextUse only the context actually returned. A handoff does not confirm payment or purchase.

The assistant receives the package first and controls the closing steps through its own tools and user approvals. The user also has the option to open the merchant page. No Shopping tool charges a card or completes a native transaction.

After an ambiguous preparation timeout, retry with the same idempotency key, identical arguments and original session. A changed selection requires a new attempt. This deduplicates handoff preparation, not a merchant purchase.

Keep the journey connected

Pass each response’s relay_context as the next call’s context. To continue to another connector, call continue_journey with journey_id, context, to_connector and optional minimized journey_context.

Inspect status and next_action first. ready provides the next tool and arguments; connection_required, connector_disabled, connector_not_authorized, connector_unavailable or installation_unknown identifies the connection step. A proposal does not perform a search, install a connector or complete a purchase.

When a journey returns to Shopping, add a product query to the proposed search arguments. Shopping does not infer a product request from travel dates or locations. See connected journeys.

Provider configuration

CapabilityConfiguration and behavior
Product search and lookupRelay enables sources with the required credentials and access. Results report source status for the request.
Offer refresh and comparisonAvailable product details and merchant offers depend on the connected source.
Purchase continuationBrowser handoffs preserve the chosen offer and destination. Merchant-cart preparation requires supported offer capabilities.

Provider credentials stay on Relay’s server. Contact Relay for endpoint and source configuration; never send provider secrets as tool arguments. Discovery access, checkout capabilities and monetization are separate.

Provider-aware access

Relay enforces authentication, scopes, rate limits and upstream denials for its own API requests. Known explicit agent restrictions are supplied as advisory context; the assistant controls independent browser continuation. Unknown policy does not remove the destination or force user-only continuation.

Keep provider identity and attribution with the returned product, offer and destination. Do not rewrite tracking parameters. Organic relevance does not depend on commission eligibility. See the Affiliate Disclosure.

Keep payment credentials, provider passwords and full conversation history out of tool arguments and logs. Use only the context needed for the request. See the Privacy Policy and shared access guide.

Freshness, limits and outcomes

Retain price_freshness, inventory_freshness and fetched_at. Refresh the chosen offer before purchase and check expires_at before continuing a handoff. Missing stock or price information stays unknown.

Respect provider request budgets and Retry-After. Use bounded retries for safe reads and avoid open-ended stock polling. Follow the idempotency rules above for handoff preparation.

A prepared handoff, click or checkout start is not a completed purchase. Wait for provider confirmation before recording a conversion. The merchant handles order support, delivery, returns and refunds.

Errors and recovery

ConditionNext action
invalid_argumentsRead tools/list; correct fields, price bounds, quantity or ID inputs.
Partial results or source errorsUse surviving products and explain missing coverage. Respect Retry-After for rate limits.
no_matching_inventory / constraints_unmetReview the query or user constraints. Do not invent an available offer.
source_unavailable / no_enabled_sourcesUse the returned coverage information or contact the operator. Do not retry unconfigured sources in a loop.
offer_reselection_required / variant_reselection_requiredRefresh get_offers, select the current offer or variant and prepare a new attempt.
price_changed / price_unavailable / offer_unavailableReview a fresh offer with the user before continuing.
unsupported_purchase_modeUse a supported returned mode; do not manufacture cart or checkout URLs.
Idempotency or session conflictRetry only the original preparation with unchanged arguments in its original session, or start a new attempt for a different selection.
Explicit agent restriction advisoryReview the supplied source under the assistant’s own rules. The handoff remains assistant-first.

Integration guides

AI assistant integration guide

Platform architecture

Provider integration guide