Skip to main content
Glama

Read customer cohorts

readCustomerStats
Read-onlyIdempotent

New versus returning customers for a period, plus top locations. Aggregates only - never individual customer data.

Only for a workspace with a store connected: listWorkspaces says which are stores.

Input Schema

NameRequiredDescriptionDefault
toNoLast day of the range, YYYY-MM-DD, today at the latest; a range is two years at most
daysNoReporting window in days
fromNoFirst day of a custom range, YYYY-MM-DD. With `to`, it takes the place of `days`
workspaceIdNoThe workspace, as listWorkspaces gives it (its id or slug). Leave it out when this connection reaches one workspace.

Output Schema

NameRequiredDescriptionDefault
newCustomersYesCustomers whose first order fell in the period
topLocationsYesUp to eight, most orders first
returningCustomersYesCustomers who ordered in the period and had ordered before it

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4/5.0
Behavior4/5

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

Beyond the readOnly/idempotent annotations, it discloses the aggregation-only privacy behavior and the store-connected precondition, which are the two things most likely to cause a wrong or failing call. Return shape is left to the output schema.

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 short sentences with the core scope front-loaded and the precondition second; nothing is redundant or padded.

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?

With full schema coverage, annotations, and an output schema, the description covers the essential prerequisites and privacy semantics. A note on behavior when no store is connected would make it complete.

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 description coverage is 100% and the schema already explains the from/to pairing, the two-year cap, and the days enum, so the description adds no parameter detail. Baseline 3 applies; the phrase 'for a period' only loosely gestures at from/to/days.

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?

States a specific verb and resource — new versus returning customers for a period plus top locations — and rules out individual-level data, which separates it from findContacts/readContact. It does not name a closest sibling outright, but the scope is unambiguous.

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?

Gives an explicit precondition (a workspace with a store connected) and points the agent to listWorkspaces to check store status, which is real routing guidance. It stops short of stating what to use instead when no store is connected or when per-customer data is needed.

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