Skip to main content
Glama

get_customers

Get customer analytics by dimension. Reports: segments (one-time/returning/VIP/at-risk), top (by spend or orders — includes customerId for each customer), by_country (geographic distribution — country is derived from order shipping address, not customer records; Shopify does not expose customer country without protected data access approval), customer_history (full order history with line items for a specific customer — use customerId from the 'top' report, or rank e.g. rank=1 for top customer, or tag to find by customer tag), tag_segments (size behavioural sub-segments by Shopify tag, signup year, marketing consent, and tag-overlap crosstab — BEST FOR: 'how many non-purchasers carry tag X?', 'break the newsletter list down by signup year', building differentiated nurture tracks. Defaults to the non-purchaser cohort; pass tags for the specific tags to count + cross-tabulate, purchaserFilter to change cohort). NOTE: For 'how many customers bought product X?' use get_orders(report: 'by_product') instead — it returns unique customer counts per product. This tool does NOT support product-level filtering.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tagNoFor customer_history: find customer by tag
rankNoFor customer_history: look up customer by rank in top customers list (e.g. 1 = top spender)
tagsNoFor tag_segments: tags to count explicitly and cross-tabulate (matched case-insensitively; always included even below minTagVolume).
limitNoNumber of results (default: 10)
reportYesReport type
sortByNoFor top: totalSpent or orders (default: totalSpent)
_offsetNoPagination offset. If a response includes _pagination.hasMore=true, use _offset to fetch the next page.
customerIdNoFor customer_history: Shopify customer ID (from the 'top' report's customerId field)
minTagVolumeNoFor tag_segments: also surface any other (non-requested) tag with at least this many customers in scope (default 200).
purchaserFilterNoFor tag_segments: which cohort to segment (default non_purchasers = ordersCount 0).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added
  2. Removed
  3. Added

TDQS

A4.5/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and largely succeeds: it discloses the country-derivation limitation (shipping address, not customer records, and Shopify access constraints), tag_segments defaults (non-purchaser cohort, minTagVolume 200), and the cross-report data flow needed to call customer_history. It does not mention pagination behavior or response shape, which is a minor omission for a read-only analytics tool.

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

Conciseness4/5

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

Front-loaded with purpose, then structured report-by-report with parenthetical detail. It is long and dense, and the tag_segments entry is notably verbose, but the length is largely justified by five distinct report modes and ten parameters. Some trimming of repeated cohort/default phrasing would tighten it.

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

Completeness4/5

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

No output schema and no annotations, so the description must carry behavior, and it does: report selection, defaults, limitations, alternatives, and data-flow prerequisites are all present. Residual gaps are pagination (only in schema) and result-format expectations, both modest for an analytics reader.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3, but the description adds real value the flat schema cannot: it maps each parameter to its report (rank, tag, customerId, sortBy, tags, purchaserFilter, minTagVolume) and explains cross-report provenance (use customerId from the 'top' report; rank=1 for top customer; tags cross-tabulates). This report-to-parameter routing is beyond what the schema conveys.

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?

States a specific verb+resource ('Get customer analytics by dimension') and then enumerates all five report modes with their distinct outputs (segments, top, by_country, customer_history, tag_segments). It explicitly rules out a nearby capability ('This tool does NOT support product-level filtering'), so an agent can differentiate it from siblings like get_orders and get_customer_insights.

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

Usage Guidelines5/5

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

Provides explicit when-to-use guidance per report, including 'BEST FOR' phrasing for tag_segments, default behaviors, and a named alternative: use get_orders(report: 'by_product') for 'how many customers bought product X?'. That is a textbook when/when-not/alternative disclosure.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources