{
  "name": "getLocationInStore",
  "description": "Find where a product is located in a physical store",
  "version": 1,
  "parameters": {
    "productName": {
      "type": "string",
      "required": true,
      "description": "The product to find in the store"
    }
  },
  "script": "async function execute(browser, params) {\n    const product = await browser.extractComponent(\n        {\n            typeName: 'ProductDetailsHero',\n            schema: '{ name: string; physicalLocationInStore?: string; aisle?: string; }'\n        },\n        params.productName\n    );\n    if (!product) {\n        throw new Error('Could not find product details for: ' + params.productName);\n    }\n    const location = product.physicalLocationInStore || product.aisle;\n    if (!location) {\n        return { success: false, message: 'Store location not available for ' + params.productName };\n    }\n    return { success: true, message: params.productName + ' is located at: ' + location, data: { location } };\n}",
  "grammarPatterns": [
    "where is $(productName:wildcard) in the store",
    "find $(productName:wildcard) in store",
    "store location of $(productName:wildcard)"
  ],
  "scope": { "type": "global" },
  "source": { "type": "manual", "timestamp": "2026-03-15T00:00:00.000Z" }
}
