Skip to content

Storefront MAS

A Storefront MAS (Multi-Agent System) handles customer conversations from the storefront chatbot. Each agent has access to a predefined set of context variables that provide insights into the customer, session, shop, and navigation state. These can be used in prompts or tool calls to personalize and control behavior.


LabelNameDescription
Shop MyShopify Domainshop.myshopifyDomainThe store’s Shopify domain, e.g., example.myshopify.com
Shop Nameshop.nameThe public name of the shop
Shop URLshop.urlThe store’s full URL
Shop Emailshop.emailEmail address of the shop owner
Shop Currency Codeshop.currencyCodeStore currency (e.g., USD, EUR, GBP)
Customer IDcustomer.idUnique identifier for the logged-in customer
Customer First Namecustomer.firstNameCustomer’s first name
Customer Last Namecustomer.lastNameCustomer’s last name
Customer Emailcustomer.emailEmail address of the customer
Customer Phonecustomer.phonePhone number of the customer
Customer Logged In?customer.loggedInWhether the customer is logged in (true/false)
Customer’s Email Verified?customer.verifiedEmailWhether the customer’s email is verified (true/false)
Session IDsession.idUnique identifier for the session
Language Codesession.languageCodeISO 639 language code for the session (e.g., en, de, tr)
IP Addresssession.meta.ipAddressVisitor’s IP address
Countrysession.meta.location.countryCountry of the session (e.g., US, DE)
Regionsession.meta.location.regionRegion or state (e.g., NY, BW)
Citysession.meta.location.cityCity (e.g., Berlin, New York)
Devicesession.deviceVisitor’s device (e.g., iPhone 16)
Browsersession.browserBrowser and version (e.g., Chrome 132)
Is Mobile?session.isMobileWhether the session is on a mobile device
Mediumsession.mediumSource of the message; always storefront in Storefront MAS
Navigation Location Typenavigation_location.typeType of the current page (product, collection, blog)
Navigation Location Handlenavigation_location.handleShopify handle of the current resource
Navigation Location Resource IDnavigation_location.resourceIdShopify GID of the resource being viewed
Store Open?store_status.isOpenWhether the store is currently open (true/false)
Next Change in Business Timezonestore_status.nextChangeInBusinessTzNext open/close time in business timezone
Current Time in UTCtime.nowInUTCCurrent timestamp in UTC
Day of Week in UTCtime.dayOfWeekInUTCDay of the week in UTC (e.g., Monday)

Tool NameDescriptionParameters
cancel_orderCancels a Shopify order by ID and reason. Sends refund, restock, and email by default.orderId (string), reason (enum: CUSTOMER, DECLINED, FRAUD, INVENTORY, OTHER, STAFF)
create_discount_codeCreates a percentage or fixed discount code, optionally scoped to specific products.type (percentage | fixed), value (number), productIds (string[])
get_customer_ordersFetches customer orders using email with pagination support.email (string), after (string), limit (number)
get_order_detailsFetches detailed information of an order by ID (must start with #).orderId (string)
get_product_detailsRetrieves product data by ID, name, or key feature using search or embedding.queryType (id | name | key feature), queryKey (string)
get_product_recommendationsRecommends products based on query keys and optional filters (price, size).queryKeys (string[]), filters (object with price and size)
get_collection_recommendationsRecommends product collections based on query keys using vector search.queryKeys (string[])
get_related_knowledge_sourceRetrieves FAQs, blog articles, PDFs, or Shopify pages relevant to a question.question (string), specificToProductId (string | null)
send_emailSends an email to a customer with subject, plain text body, and HTML content.email (string), subject (string), body (string), html (string)
send_otp_emailSends an OTP email to the customer for verification.email (string)
send_noteSends a private note to the dashboard visible only to store staff.content (string)
  • Welcome Message - The message that is sent to the customer when they start a conversation.
  • Conversation Starters - The suggestive_answers that is sent to the customer when they start a conversation.

Here’s a clean and user-friendly documentation section for the Agent Output Types of both Email MAS and Storefront MAS, ready to be placed in your User Manual:


Agents produce structured responses when they complete their tasks. The response format differs depending on whether the MAS is an Email MAS or a Storefront MAS.



FieldTypeDescription
contentstringThe main message to show to the customer.
suggestive_answersstring[]Optional list of buttons the customer can click (e.g., “Track my order”).
recommended_productsstring[]Array of Shopify product IDs (e.g., gid://shopify/Product/12345) to show as product cards.
formsobject[]Optional list of forms that the agent wants the user to fill. Each form contains a type and list of fields.

Form Schema:

{
type: string; // e.g., "contact", "return_request"
fields: {
name: string; // Field name
type: string; // e.g., "text", "email", "number"
}[]
}

Example:

{
"content": "I can help with that. Please fill in the form below.",
"suggestive_answers": ["Cancel my order", "Track shipment"],
"recommended_products": ["gid://shopify/Product/123", "gid://shopify/Product/456"],
"forms": [
{
"type": "return_request",
"fields": [
{ "name": "Order ID", "type": "text" },
{ "name": "Reason", "type": "text" }
]
}
]
}