hdls Analytics
hdls Analytics is a headless, MCP-native product & event analytics backend. It manages events, users, and funnels, operated entirely through named tools your AI assistant calls. It stands in for tools like Mixpanel, Amplitude — same job, no UI to run.
💬 Just ask
"Track a signup event, then show me this week's events."
You don't call these tools yourself — just tell your assistant in plain English. Everything below is the reference for when you (or your assistant) want the exact details.
How Analytics is organized
The headline entity is the event — start there, then attach the rest to it. The event table is an append-only timeline — every change and note lands there and is never edited or deleted.
| Entity | Purpose | Relates to |
|---|---|---|
event | Append-only immutable behavioural event (primary high-volume entity) powering funnels, retention and segmentation. | profile |
profile | A tracked user/identity with merged properties; events join to it via distinct_id. | — |
funnel | A saved ordered sequence of event steps used to measure conversion within a window. | — |
cohort | A saved user-segment definition used for retention analysis and segmentation. | — |
Tools
Call these at https://hdls.ai/api/mcp/analytics. Required fields you must supply; optional fields refine the call. You never pass tenant_id — it is stamped server-side.
Update & advance
| Tool | What it does | Required | Optional |
|---|---|---|---|
track_event | Track event. | distinct_id, name | profile_id, session_id, properties, occurred_at, data |
Find & read
| Tool | What it does | Required | Optional |
|---|---|---|---|
query_events | Query the event stream. | — | — |
build_funnel | Build a conversion funnel from events. | — | — |
list_users | Search users by free-text and/or column filters (tenant-scoped, paginated). | — | search, filters, limit, orderBy |
retention | Compute retention across cohorts. | — | — |
Field lists come from the product's live schema and are embedded in each tool's own description — read the tool description for the exact, current fields.
Field reference
Every field you can set on each record. Custom fields you add live alongside these in data.
profile
| Field | Type | Required | Notes |
|---|---|---|---|
distinct_id | text | Yes | Reference to a related record. |
email | text | ||
name | text | Display name. | |
first_seen_at | timestamp | ||
last_seen_at | timestamp | ||
properties | json | ||
data | json | Free-form JSON — custom fields live here. |
funnel
| Field | Type | Required | Notes |
|---|---|---|---|
name | text | Yes | Display name. |
description | text | ||
steps | json | ||
window_days | number | ||
data | json | Free-form JSON — custom fields live here. |
cohort
| Field | Type | Required | Notes |
|---|---|---|---|
name | text | Yes | Display name. |
description | text | ||
definition | json | ||
is_dynamic | true / false | ||
member_count | number | ||
data | json | Free-form JSON — custom fields live here. |
Tailor it with custom fields
Add fields without a schema change. add_custom_field defines one, list_custom_fields shows what's defined, and promote_custom_field (admin) shares a personal field with the whole workspace. The value lives in each row's data (JSON) and is set and read through the normal record tools. See Products, tools & custom fields for the full model.
Roles & safety
- Tenant isolation is automatic. Your credential is pinned to one workspace; you never pass
tenant_id, and you can only ever see your own data (enforced by Postgres row-level security). - Role-gated. Permissions run
reader < member < admin < owner. Installing a product and promoting a custom field workspace-wide need admin/owner. - History is append-only. The
eventtimeline is never edited or deleted — it's your audit trail.
Connect
On the concierge (https://hdls.ai/api/mcp), run install_product({ slug: "analytics" }) (admin/owner) to enable it for your workspace, then add https://hdls.ai/api/mcp/analytics as a connector in your assistant — see Connect your assistant.
A worked example
The literal call your assistant makes when you ask it to create the headline record:
Tool: track_event
Arguments: {
"distinct_id": "example",
"name": "Acme Corp"
}