# MCP use cases

Real questions you can ask once datacub is connected, and what your assistant does to answer each one. Ask in Arabic or English; the numbers are the same.

Your assistant starts with `list_projects` to find your project, then picks the tools below. You never need to name a tool. Every answer has a link back to the same view in datacub.

## Understand your traffic

| Ask | What the assistant does |
|---|---|
| "How did we do this week?" | `web_overview` for the last 7 days: visitors, sessions, bounce, new and returning against the week before, with top pages, sources, countries and devices |
| "Why did visitors drop yesterday?" | `explain_change` ranks the channels, sources, pages, countries and devices that moved the number most, each with its share of the change; `trend` confirms the one that stands out |
| "Compare Ramadan with the month before." | `compare_periods` puts the two date ranges side by side, with the change for each number |
| "Which sources bring people who sign up?" | `trend` or `query_analytics` on your sign-up event, split by source; `list_event_definitions` first, to use the exact event name |
| "Who is on the site right now?" | `live_now`: people online, people per minute over the last 30 minutes, and the pages, countries and sources they came from |

## Conversion

| Ask | What the assistant does |
|---|---|
| "Where do people drop off in checkout?" | `list_saved_funnels` and `run_saved_funnel` for your team's own checkout funnel, or `funnel` built from your real event names; then the step that loses the most people |
| "What do people do instead of paying?" | `funnel_next` with the step they stopped at: the first page, click or event they did next |
| "Do phone users convert worse than desktop?" | `run_saved_funnel` or `funnel` with a breakdown by device |
| "Where do people go after the home page?" | `paths` from the home page, step by step |

## Retention and engagement

| Ask | What the assistant does |
|---|---|
| "Do new users come back?" | `retention`: cohorts by first visit and the share who came back each week |
| "Is growth coming from new people or from keeping them?" | `lifecycle`: new, returning, back after a gap, and gone, per week |
| "Which features do active users use most?" | `feature_adoption`: your events and named clicks by how many active people use them, against the previous period |
| "How often do people use the app, and when?" | `engagement`: active people, weekday and hour, how often they come back; `active_users` for daily, weekly and monthly active |

## People

These need the Member role or above on the project. Your assistant never sees anyone's email, name or phone number.

| Ask | What the assistant does |
|---|---|
| "Who are my best users, and what do they have in common?" | `find_people` with `power` (active on 4 or more days), then `investigate_users` to compare where they come from, their country and device |
| "Show me people who signed up but never paid." | `find_people` with conditions: did the sign-up event, did not do the payment event |
| "What did this person do on their last visit?" | `get_person`: the profile and latest visits, every page, click and event. Opening a profile is recorded, as in the dashboard |

## Act on it

These change something, so they run only when you ask, on a connection you allowed to make changes, with the Member role or above.

| Ask | What the assistant does |
|---|---|
| "Start an A/B test of the new checkout, measured on payment." | `list_flags` to reuse an existing key, then `create_flag` with kind experiment and your success event; later `get_experiment_results`, which says whether there is evidence yet |
| "Roll the new menu out to 20% of users." | `update_flag` with a rollout of 20 |
| "Ask people who finished checkout how easy it was." | `list_feedback` to avoid asking twice, then `create_feedback_question` on your checkout event; `publish_feedback_question` when you agree |
| "What did people answer to the NPS question?" | `get_feedback_results`: answers per score, the NPS, and how many closed or ignored it |

## Set up datacub in your code

For coding assistants such as Claude Code, Cursor, Codex and VS Code.

| Ask | What the assistant does |
|---|---|
| "Add datacub to this app." | `get_sdk_setup` for the exact install steps with your project ID, adds the SDK, identifies signed-in users and tracks your key events; then `get_integration_status` to check events arrive |
| "Is datacub set up right?" | `get_integration_status` and `list_event_definitions`: are events arriving, is `identify()` called, which business events are missing |
| "Declare our checkout_completed event and its properties." | `register_event_definition`, on a connection allowed to make changes |

## Ready-made prompts

Your tool lists these as commands or prompts. Each one runs the right tools in order, with fresh numbers.

| Prompt | What it does |
|---|---|
| **Weekly review** (`weekly_review`) | the week against the one before, what drove the biggest move, your saved funnels, engagement and feedback; three things to do this week |
| **Why did it change?** (`why_did_it_change`) | finds what moved a number, and checks it is not a tracking problem |
| **Check my datacub setup** (`check_my_setup`) | events, identify and business events; adds what is missing if it can see your code |
| **Where do people drop off?** (`find_funnel_leaks`) | the step that loses the most people, who they are and what they do instead |
| **Who are my best users?** (`who_are_my_best_users`) | what your most engaged people have in common, and how to get more like them |
