Skip to main content
Glama

shopify_shopifyql

Read-only

Run ShopifyQL analytics queries on Shopify store data to extract metrics such as sales, orders, sessions, and customer insights.

Instructions

Run a ShopifyQL analytics query against a Shopify store.

ShopifyQL is Shopify's SQL-like reporting language. Requires read_reports scope. Consumes the same cost bucket as GraphQL.

Syntax: FROM SHOW [, ...] [BY ] [GROUP BY ] [WHERE ] [SINCE -Nd UNTIL today] [ORDER BY [ASC|DESC]] [LIMIT N]

Datasets: sales, orders, products, customers, inventory, sessions. Time tokens: -Nd / -Nw / -Nm / -Nq / -Ny, or named (today, yesterday, this_week, last_week, this_month, last_month, last_year).

Examples:

  • FROM sales SHOW total_sales GROUP BY day SINCE -7d UNTIL today ORDER BY day ASC

  • FROM sales SHOW total_sales BY product_title ORDER BY total_sales DESC LIMIT 10 SINCE -30d

  • FROM sales SHOW returning_customer_rate GROUP BY month SINCE -6m

  • FROM sales SHOW net_sales SINCE -1q UNTIL today

  • FROM sessions SHOW sessions, conversion_rate GROUP BY referrer_source SINCE -14d

Returns tableData.columns, tableData.rows, and parseErrors. When parsing fails, tableData is null and parseErrors contains a list of human-readable error strings (e.g. "Column 'total_sale' not found").

Args: query: ShopifyQL query string. shop: Store alias or domain. Required when multiple stores are configured. api_version: Override API version (default "2026-04").

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
shopNo
queryYes
api_versionNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.1.0

TDQS

A4.8/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already mark readOnlyHint, but the description adds substantial behavioral context: it specifies the cost bucket shared with GraphQL, returns `tableData.columns`, `tableData.rows`, and `parseErrors`, and explains the error behavior when parsing fails. This goes well beyond what the annotations declare, providing concrete operational expectations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is long but tightly organized: a one-line purpose, a syntax block, dataset/token listings, several examples, and a return-format note. Each section earns its place, and the most critical information is front-loaded. No fluff or repetition.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with a complex query language, the description is remarkably complete. It covers the syntax, allowed datasets, time tokens, example usages, return structure, and error handling. It even notes the API version default. There is no obvious missing information an agent would need to call it correctly, and the presence of an output schema further reduces the need for return-type detail.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must fully compensate. It does: it explains the `query` syntax in detail, clarifies `shop` as 'store alias or domain. Required when multiple stores are configured', and notes `api_version` overrides the default '2026-04'. This adds meaning far beyond the bare schema types.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The first sentence states a specific verb ('Run'), resource ('ShopifyQL analytics query'), and target ('against a Shopify store'). The description also distinguishes it from siblings by positioning it as a reporting-language query, separate from GraphQL and bulk tools.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description clearly explains the tool's domain ('analytics query', SQL-like reporting) and notes the required scope ('read_reports') and that it consumes the same cost bucket as GraphQL. However, it does not explicitly contrast with sibling tools (e.g., 'use this for analytics, use GraphQL for other queries'). The guidance is strong but not fully explicit about when to choose this over alternatives.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.