Skip to main content
Glama
Shopify Analytics MCP Server

Shopify Analytics MCP Server

by DrMatrixx

get_customer_churn_risk

Identify customers at risk of churning by analyzing purchase patterns and flagging those overdue for reorder, sorted by lifetime spend to prioritize retention outreach.

Instructions

Identify customers at risk of churning based on their purchase patterns. Finds customers who have gone significantly longer than usual without ordering, sorted by lifetime spend.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "get_customer_churn_risk"
  }
}

Input Schema

NameRequiredDescriptionDefault
limitNoMaximum number of at-risk customers to return (default: 20)
periodNoDate range for analysis (default: last_12m). Supports: last_7d, last_30d, last_90d, last_12m, this_year, last_year, or YYYY-MM-DD:YYYY-MM-DD

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.1.0

TDQS

A3.5/5.0
Behavior3/5

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

With no annotations, the description carries the full behavioral burden. It helpfully discloses the detection heuristic and sort order, but "significantly longer than usual" is an undefined threshold, so the agent cannot characterize what counts as at-risk, and the description never states that this is a read-only, non-mutating operation.

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?

Two tightly written sentences with zero filler, and the core definition is front-loaded ahead of the supporting detail about sort order.

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

Completeness3/5

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

For a two-parameter read tool with no output schema and no annotations, the description should say what a result row contains or at least that results are ranked by spend (it partially does). It leaves key gaps: the churn threshold is undefined and the return shape is unstated, which matters since there is no output schema.

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

Parameters3/5

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

Schema coverage is 100%, so both parameters (limit, period) are already fully documented, including the accepted date-range values. The description adds no meaning beyond that – notably, it does not explain how the period interacts with the churn heuristic (e.g., baseline window vs. analysis window).

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

Purpose4/5

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

The description uses specific verbs ("Identify", "Finds") on a clear resource (customers at churn risk) and even discloses the heuristic (gone significantly longer than usual without ordering) and ordering (lifetime spend). It does not name a sibling to contrast with, so the agent must infer how it differs from get_customer_rfm_segments or get_customer_health_report.

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

Usage Guidelines3/5

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

Usage is implied by the churn framing, so an agent can reasonably guess the use case. However, there is no explicit when-to-use, when-not-to-use, or named alternative, and nothing tells the agent whether to prefer this over the RFM or health-report siblings for overlapping questions.

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