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.

EntityPurposeRelates to
eventAppend-only immutable behavioural event (primary high-volume entity) powering funnels, retention and segmentation.profile
profileA tracked user/identity with merged properties; events join to it via distinct_id.
funnelA saved ordered sequence of event steps used to measure conversion within a window.
cohortA 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

ToolWhat it doesRequiredOptional
track_eventTrack event.distinct_id, nameprofile_id, session_id, properties, occurred_at, data

Find & read

ToolWhat it doesRequiredOptional
query_eventsQuery the event stream.
build_funnelBuild a conversion funnel from events.
list_usersSearch users by free-text and/or column filters (tenant-scoped, paginated).search, filters, limit, orderBy
retentionCompute 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

FieldTypeRequiredNotes
distinct_idtextYesReference to a related record.
emailtext
nametextDisplay name.
first_seen_attimestamp
last_seen_attimestamp
propertiesjson
datajsonFree-form JSON — custom fields live here.

funnel

FieldTypeRequiredNotes
nametextYesDisplay name.
descriptiontext
stepsjson
window_daysnumber
datajsonFree-form JSON — custom fields live here.

cohort

FieldTypeRequiredNotes
nametextYesDisplay name.
descriptiontext
definitionjson
is_dynamictrue / false
member_countnumber
datajsonFree-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 event timeline 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"
}

See All products · Connect your assistant · Automation