HF_AGENT / shopify_tools.py
Brettapps's picture
Syncing files from local MCP agent storage
a9a3550 verified
Raw
History Blame Contribute Delete
601 Bytes
import json
import shopify
def get_product_details(handle):
try:
# Shopify products can be searched by handle using the API
products = shopify.Product.find(handle=handle)
if products:
product = products[0]
return json.dumps({
"title": product.title,
"handle": product.handle,
"status": product.status,
"product_type": product.product_type
})
return json.dumps({"error": "Product not found"})
except Exception as e:
return json.dumps({"error": str(e)})