# Sensors Data MCP

> Sensors Data connects your AI agent directly to a professional big data analytics platform. It provides ten tools for analyzing user behavior: calculate retention rates (`analyze_retention`), map conversion funnels (`analyze_funnel`), and retrieve deep behavioral profiles for specific users. Use it to query event metadata, check data pipeline health, and understand how people actually use your product.

## Overview
- **Category:** productivity
- **Price:** Free
- **Tags:** sensors-data, big-data, user-behavior, event-tracking, data-ingestion, behavioral-analytics

## Description

Yo, listen up. This Sensors Data MCP Server connects your AI agent straight to a professional big data analytics platform—no custom queries needed. It gives you ten tools designed for analyzing user behavior, letting you understand exactly how people are using your product.

When you use this server, your agent can calculate conversion metrics across defined paths by running `analyze_funnel`. If figuring out if users stick around is what you need, you call `analyze_retention`; that tool spits out retention rates for specific time periods. You'll also get a general idea of user activity using `query_behavior_list` or seeing detailed raw interactions with the `analyze_events` tool.

To map a single person’s entire journey, you pull the exact chronological sequence of actions they took by running `get_user_behavior_sequence`. For those deep dives into what properties and data fields are available for any given event type, you check `get_event_schema`, or if you need to see every unique event name currently defined in your project's schema, you use `list_events`.

When it comes to user profiles, you look up specific users using `lookup_user`—that gives you their full profile attributes, like what category they belong to or if they're a high-value status. If you need to know all the available fields that can be used in any user profile across your system, run `list_user_properties`. 

For verifying your data structure and project setup, you grab metadata about the current Sensors Data project with `get_project_info`, which confirms your configuration settings. You'll also find a list of all available attributes that define raw event metadata using `list_user_properties`.

Essentially, this server lets your agent break down user activity into three main areas: measuring how people move through the product using funnel and retention analysis; mapping out individual paths or broad trends using sequence and event tools; and verifying data integrity by checking schemas, listing available fields, and confirming project metadata.

## Tools

### analyze_events
Performs detailed analysis on raw event data, allowing you to understand user interactions in depth.

### analyze_funnel
Calculates conversion metrics across predefined steps or stages of the user journey.

### analyze_retention
Determines how many users return to the platform over defined time periods, calculating retention rates.

### get_event_schema
Retrieves a full list of properties and data fields associated with a specific event type.

### get_project_info
Gets metadata about the current Sensors Data project, useful for verifying configuration settings.

### get_user_behavior_sequence
Pulls the exact chronological order of events a user performed, recreating their path through your product.

### list_events
Lists all unique event names currently defined within your project's schema.

### list_user_properties
Retrieves a list of all available attributes and fields used in user profiles.

### lookup_user
Gets the full profile information for any specific user ID provided.

### query_behavior_list
Retrieves a generalized list of user behaviors or events, useful for broad trend analysis.

## Prompt Examples

**Prompt:** 
```
Show me the top 5 events by volume in project 'MainApp' for today.
```

**Response:** 
```
Retrieving event statistics for 'MainApp'... The top 5 events today are: 1. page_view (1.2M), 2. item_click (450K), 3. user_login (120K), 4. add_to_cart (85K), 5. purchase_complete (12K). Would you like to see the conversion rate between these?
```

**Prompt:** 
```
Get the behavioral attributes for user ID 'user_sensors_777'.
```

**Response:** 
```
Querying user profile... User 'user_sensors_777' is categorized as a 'High-Value Customer' with 15 purchases in the last 30 days. Preferred category: 'Electronics'. Last active: 10 minutes ago.
```

**Prompt:** 
```
Is the data ingestion pipeline healthy for project 'AnalyticsBeta'?
```

**Response:** 
```
Checking pipeline health for 'AnalyticsBeta'... Current status: Healthy. Ingestion rate is 15K events/sec with zero reported errors in the last hour. Connectivity to the Sensors Data cluster is stable.
```

## Capabilities

### Calculate Conversion Funnels
Runs funnel analysis tools (`analyze_funnel`) to calculate conversion metrics across defined user paths.

### Analyze User Retention
Determines how many users return over time using `analyze_retention`, giving you the core health metric of your product adoption cycle.

### Retrieve Event Details and Schemas
Uses `get_event_schema` or `list_events` to understand exactly what properties and data fields are available for any given event type.

### Build User Journeys
Pulls the complete, chronological sequence of actions taken by a user using `get_user_behavior_sequence` or `query_behavior_list`.

### Get Core Profile Information
Looks up specific users (`lookup_user`) to pull their profile attributes, such as category or value status.

### Monitor Data Pipeline Health
Checks the data stream's health and ingestion rates to confirm your analytics pipeline is running without errors.

## Use Cases

### Diagnosing Feature Failure
A Product Manager noticed that signups are high but paid conversions are low. Instead of guessing, they ask the agent to run `analyze_funnel` from 'Sign Up' to 'Purchase'. The result shows a massive drop-off at the payment screen, pointing directly to an issue with the checkout flow.

### Identifying Power Users
A Growth Engineer needs to understand what makes their most valuable users different. They use `lookup_user` on several top accounts and cross-reference those results with `list_user_properties` to find a common attribute, like 'Uses the Reporting Module,' that defines high value.

### Investigating Abandoned Sessions
A Data Analyst finds an unusual spike in user activity but no corresponding sales. They ask the agent for `get_user_behavior_sequence` on a few affected IDs, which reveals that users were repeatedly getting stuck on a specific screen flow.

### Checking Data Integrity
A DevOps team member is worried about data quality. They run the pipeline health check and use `get_project_info` to verify connectivity and token validity before starting any analysis, preventing bad reports.

## Benefits

- Stop writing complex SQL for basic metrics. With `analyze_retention`, you get the direct metric of user stickiness—how many users come back after 30 days—without touching a database query.
- Map out drop-off points instantly. Instead of guessing where your sales funnel leaks, use `analyze_funnel` to calculate precise conversion rates between steps (e.g., 'View Product' to 'Checkout').
- Understand the user's story. The `get_user_behavior_sequence` tool builds a perfect timeline of events for any single ID, letting you see exactly what they did right before they left.
- Avoid schema confusion. Before writing anything, run `list_events` or `get_event_schema`. This tells your agent the exact properties and fields available for that event type, keeping your queries clean.
- Get context on the fly. Use `lookup_user` to pull a user's core profile details (like 'High-Value Customer') alongside their recent activity, making segmentation trivial.

## How It Works

The bottom line is: you tell your AI client what question to ask, and it handles the complex connection and query logic to pull the answer directly from your raw event logs.

1. First, you need a Project Name and API Token. You get these by navigating to the 'API Access' section in the Sensors Data Dashboard.
2. Next, your AI client uses natural language instructions (e.g., 'Show me retention for last quarter') which are translated into tool calls like `analyze_retention`.
3. The server executes the call against the live data platform and sends back structured results—like a list of top events or a calculated conversion rate.

## Frequently Asked Questions

**How do I check if a certain field exists for my events using get_event_schema?**
You call `get_event_schema` and provide the event name you are interested in. The server returns a list of all available properties, confirming exactly what data fields you can query.

**What is the difference between list_events and query_behavior_list?**
`list_events` gives you the names of all possible event types (e.g., 'login', 'checkout'). `query_behavior_list` actually retrieves a list of past user actions, using those defined events.

**Can I use analyze_funnel to compare two different product lines?**
Yes. You can define separate funnels for distinct groups by providing the specific criteria or segments in your prompt and letting the agent execute multiple `analyze_funnel` calls.

**What data do I need to run analyze_retention?**
You must specify a time period (e.g., 'the last 90 days') and the definition of an active user, as `analyze_retention` needs boundaries to calculate returning users.

**Do I need an API key for lookup_user?**
Yes. The tool requires a valid Project Name and API Key (Token) for authentication before it can pull profile data for a specific user ID.

**When I use `get_project_info`, what specific metadata do I get about my Sensors Data project?**
It returns key project settings, including your API version and the current status of the data source. This is useful for confirming that your connection parameters are correct before running any heavy analysis.

**How can I use `get_user_behavior_sequence` to limit my event list to a specific date range?**
You must include start and end timestamps in the request payload. The tool then returns the user's events strictly within that time window, allowing you to focus on behavior from a single day or week.

**If `analyze_events` fails with an error code, what should I check first?**
The response will detail if the failure is due to invalid parameters, schema mismatches, or resource limits. Always verify your project name and required event properties before re-running the query.

**Can I automatically retrieve the behavioral profile for a specific user ID?**
Yes! Use the `get_user_profile` tool with the specific User ID. Your agent will return all recorded attributes and recent behavioral events associated with that user.

**How do I monitor the data ingestion status via the AI agent?**
Use the `get_ingestion_health` tool. The agent will retrieve real-time statistics on data volume, successful ingestions, and any flagged errors in your pipeline.

**Can I list all events tracked in a specific project?**
Yes! Use the `list_events` tool. Your agent will return a list of all event names and their associated metadata currently configured in your Sensors Data project.