Shopify - GoMarble AI

Shopify

2

min read

Sankalp

Shopify E-Commerce MCP Tools

Overview

The Shopify MCP (Model Context Protocol) tools provide comprehensive access to your e-commerce store data through Shopify's powerful GraphQL Admin API. This integration enables seamless analysis of sales performance, customer behavior, product data, and business metrics without exposing any personal identifiable information (PII).

Key Benefits

Tool Reference

1. Get Sales Data by Query

Purpose: Analyze comprehensive sales performance with detailed revenue metrics and order statistics.

What it does: Retrieves complete sales data for orders matching your search criteria, including gross sales, discounts, order counts, and average order values. All data is automatically aggregated across currencies and time periods.

Key Parameters:

Sales Metrics Retrieved:

Sample Use Cases:

Example Query:

query:"created_at:>=2024-01-01 AND created_at:<=2024-01-31 AND financial_status:paid"

Example Output

{ "sales_data":{ "gross_sales":125450.75, "total_discounts":12545.08, "order_count":847, "average_order_value":148.11, "currency":"USD", "date_range":"2024-01-01 to 2024-01-31" } }

2. Get Customers Count by Query

Purpose: Analyze customer segments and measure audience growth without accessing personal information.

What it does: Returns precise customer counts for any segment or filter criteria. Perfect for measuring marketing effectiveness, segment sizing, and customer lifecycle analysis.

Key Parameters:

Customer Segmentation Options:

Sample Use Cases:

Example Query:

query:"accepts_marketing:true AND total_spent:>500 AND country:US"

Example Output:

{ "customer_count":2847, "query_criteria":"accepts_marketing:true AND total_spent:>500 AND country:US", "segment_description":"US customers who accept marketing with >$500 lifetime spend" }

3. Get Orders Count by Query

Purpose: Quick order volume analysis and sales trend measurement across any time period or criteria.

What it does: Provides exact order counts for any filter combination, enabling rapid analysis of sales patterns, seasonal trends, and operational metrics.

Key Parameters:

Order Analysis Dimensions:

Sample Use Cases:

Example Query:

query:"created_at:>=2024-12-01 AND created_at:<=2024-12-31 AND fulfillment_status:fulfilled"

Example Output:

{ "order_count":1456, "query_criteria":"Holiday season fulfilled orders", "time_period":"December 2024" }

4. List Products by Query

Purpose: Browse and analyze product catalog with flexible filtering for inventory and merchandising decisions.

What it does: Returns product listings with essential information including titles, descriptions, and global IDs. Optimized for product discovery, catalog management, and inventory analysis.

Key Parameters:

Product Filtering Options:

Sample Use Cases:

Example Query:

query:"product_type:electronics AND inventory_total:>0 AND status:active"

Example Output:

{ "products":[

{ "gid":"gid://shopify/Product/123456789", "title":"Wireless Bluetooth Headphones", "description":"Premium noise-canceling headphones...", "product_type":"electronics" }

], "total_found":847, "has_next_page":true }

5. List Orders by Query

Purpose: Detailed order analysis with comprehensive filtering for sales operations and customer service.

What it does: Retrieves order listings with essential data including dates, values, and order IDs. Designed for sales analysis, order management, and customer service workflows.

Key Parameters:

Order Data Retrieved:

Sample Use Cases:

Example Query:

query:"financial_status:paid AND total_price:>100 AND shipping_address_country:CA"

6. List Customers by Query

Purpose: Customer segment analysis and audience insights while maintaining complete privacy protection.

What it does: Provides customer listings with anonymized references and global IDs. Perfect for segment analysis, marketing planning, and customer behavior studies without exposing personal information.

Key Parameters:

Customer Insights Available:

Sample Use Cases:

Example Query:

query:"orders_count:>10 AND total_spent:>1000 AND accepts_marketing:true"

7. Get All Details by GID

Purpose: Comprehensive object analysis using Shopify's Global ID system for deep-dive insights.

What it does: Retrieves complete details for any Shopify object (Product, Order, or Customer) using its Global ID. Provides maximum detail while maintaining privacy standards.

Key Parameters:

Detailed Data by Object Type:

Products:

Orders:

Customers:

Sample Use Cases:

Example GID Formats:

Product:"gid://shopify/Product/123456789"

Order:"gid://shopify/Order/987654321"

Customer:"gid://shopify/Customer/456789123"

Advanced Search Syntax

Query Language Fundamentals

Shopify's search syntax enables sophisticated filtering across all tools. The syntax supports terms, connectives, modifiers, and comparators for precise data retrieval.

Basic Structure:

field_name:value

field_name:>value(greater than)

field_name:<value(less than)

field_name:>=value(greater thanorequal)

field_name:<=value (less than or equal)

Connectives:

Modifiers:

Common Search Fields by Object

Product Queries:

title:wireless

product_type:electronics

vendor:Apple

status:active

inventory_total:>0

created_at:>=2024-01-01

tag:bestseller

price:>50

Order Queries:

created_at:>=2024-01-01

financial_status:paid

fulfillment_status:fulfilled

total_price:>100

shipping_address_country:US

utm_source:facebook

utm_campaign:summer2024

customer_id:123456

Customer Queries:

customer_date:>=2024-01-01

total_spent:>500

orders_count:>5

accepts_marketing:true

country:US

state:ENABLED

email:*@gmail.com

tag:vip

Advanced Query Examples

Complex Product Analysis:

(product_type:clothing OR product_type:accessories)AND

vendor:Nike AND

inventory_total:>10AND

-tag:discontinued AND

price:>=25AND price:<=200

Sales Performance Analysis:

created_at:>=2024-01-01AND created_at:<=2024-12-31 AND

financial_status:paid AND

(utm_source:google OR utm_source:facebook) AND

total_price:>75 AND

shipping_address_country:US

Customer Segmentation:

total_spent:>1000AND

orders_count:>5AND

accepts_marketing:trueAND

customer_date:>=2023-01-01AND

country:US AND

-tag:wholesale

Getting Started
Prerequisites
Required API Scopes
Basic Workflow
  1. Discovery: Start with count queries to understand data volumes
  2. Segmentation: Use filtering to identify relevant data subsets
  3. Analysis: Retrieve detailed data for specific objects using GIDs
  4. Insights: Combine multiple tools for comprehensive business analysis
  5. Optimization: Use findings to improve sales, marketing, and operations
Common Analysis Workflows
Sales Performance Dashboard

Daily Revenue Tracking:

1.Get sales data forcurrent month 2.Get order counts by week 3.Analyze top-performing product types 4.Track average order value trends

Campaign Performance Analysis:

1.Filter orders by UTM parameters 2.Calculate conversion rates and ROI 3.Analyze customer acquisition costs 4.Track geographic performance

Customer Intelligence

Segment Analysis:

1.Count customersinkey segments 2.Analyze purchase behavior patterns 3.Identify high-value customer characteristics 4.Track customer lifecycle progression

Marketing Optimization:

1.Size email marketing audiences 2.Analyze customer lifetime values 3.Identify cross-sell opportunities 4.Track retention and churn patterns

Inventory Management

Product Performance:

1.List products by performance metrics 2.Analyze inventory levels and turnover 3.Identify bestsellers and slow movers 4.Track seasonal demand patterns

Catalog Optimization:

1.Review product descriptions and tags 2.Analyze pricing strategies 3.Identify collection performance 4.Track vendor contributions

Best Practices

Data Retrieval Efficiency

Query Optimization:

Performance Guidelines:

Analysis Strategy

Structured Approach:

Data Privacy:

Advanced Features

Multi-Currency Support

All sales data tools automatically handle multi-currency stores, providing:

Pagination Handling

The tools automatically manage pagination across large datasets:

Real-Time Data Access

Integration with Shopify's live data systems ensures: