MCPToolsCDP tools
Query Metrics
sum / avg / min / max over a property, for profiles or events
cdp_query_metrics
Computes numeric metrics — any of sum, avg, min, max — over one property for your brand's profiles or events. Optionally pass a condition to filter the population first. Call cdp_list_properties for the allowed property paths and condition vocabulary.
Read-only and scoped to your brand.
Parameters
| Name | Type | Required | Description | Default |
|---|---|---|---|---|
item_type | string | Yes | Which store to aggregate over: profile or event. | — |
property | string | Yes | The numeric property path. Profiles allow properties.*; events allow properties.*, flattenedProperties.*, and timeStamp. e.g. properties.amount (event) or properties.totalSpend (profile). Must be allowlisted; scope/shopDomain paths are rejected. | — |
metrics | string[] | Yes | Which metrics to compute — a non-empty subset of sum, avg, min, max. | — |
condition | object | No | A Unomi condition to filter the population before aggregating (allowlisted vocabulary only). | — |
Scope/shopDomain property paths and condition predicates are rejected — the owning scope is enforced by the server.
Returns
itemType,property— echoed back.metrics— the computed values, keyed like_sum,_avg,_min,_max, plus_count(the matched-item count). Over an empty population_avg/_min/_maxcome back asnull(neverInfinity) and_countis0.scope— your brand's shop domain.
Example prompts
What's the average total spend across my profiles?Sum the amount on order_created events for last monthNotes
- The brand scope is injected server-side, so the metric only ever covers your own items.
- The
property,metrics, and anyconditionare validated against the allowlist before the query runs; an invalid input returns a clear error and no query. - Aggregate queries are throttled — on a rate limit, the tool returns a clear rate-limit error.