Explore Mixpanel schema, discover events, and analyze data structure.
Inspect Mixpanel schema, events, properties, and local data tables. Use this to discover what data is available in your project or explore fetched data before running queries.
/plugin marketplace add jaredmcfarland/mixpanel_data/plugin install mixpanel-data@mixpanel-dataExplore Mixpanel schema, discover events, and analyze data structure.
Check credentials and local data availability:
!$(mp auth test 2>&1 || echo "⚠️ No credentials configured")
!$(mp inspect tables --format table 2>/dev/null || echo "No local tables found")
If no credentials: Suggest running /mp-auth first.
Guide based on data availability:
Choose an inspection operation from $1 or present menu:
Discover all event names tracked in your Mixpanel project.
!$(mp inspect events --format table)
Output: List of all event names alphabetically sorted.
Filter with jq (JSON format only):
# Get first 5 events
mp inspect events --format json --jq '.[:5]'
# Find events containing "User"
mp inspect events --format json --jq '.[] | select(contains("User"))'
# Count total events
mp inspect events --format json --jq 'length'
Chain suggestions:
/mp-inspect properties <event-name> to see its properties/mp-fetch with filtered event listmp inspect top-events --format tableShow all properties tracked for a specific event.
$2 if provided (e.g., /mp-inspect properties PageView)events operation first if unsure!$(mp inspect properties -e "<event-name>" --format table)
Output: Property names, data types, and example values.
Chain suggestions:
/mp-inspect distribution <property-name>/mp-fetch with WHERE clause on this property/mp-query sql with properties->>'$.propname'List all saved funnel definitions in your Mixpanel project.
!$(mp inspect funnels --format table)
Output: Funnel ID, name, and step count.
Chain suggestions:
/mp-funnel <funnel-id>/mp-funnel and choose custom optionmp query funnel <funnel-id> --from <date> --to <date>List all saved cohorts in your Mixpanel project.
!$(mp inspect cohorts --format table)
Output: Cohort ID, name, count, and description.
Chain suggestions:
mp fetch profiles --cohort <cohort-id>/mp-retention with cohort context/mp-fetch WHERE clauseList all DuckDB tables in your local workspace.
!$(mp inspect tables --format table)
Output: Table names, row counts, and last fetch timestamp.
Chain suggestions:
/mp-fetch to get started/mp-inspect schema <table-name>/mp-inspect sample <table-name>/mp-inspect breakdown <table-name>Show column definitions for a specific table.
$2 if provided (e.g., /mp-inspect schema events)tables operation first if needed!$(mp inspect schema -t "<table-name>" --format table)
Output: Column names, data types, and nullable status.
Key columns:
event_name - Event type identifierevent_time - Timestamp of eventdistinct_id - User identifierproperties - JSON column with all event propertiesChain suggestions:
/mp-inspect sample <table-name>/mp-inspect breakdown <table-name>/mp-query sql with this table/mp-inspect keys <table-name>Show random sample rows from a table.
$2 if provided, otherwise ask-n flag!$(mp inspect sample -t "<table-name>" -n 10 --format table)
Output: Random rows with all columns.
Interpreting JSON properties:
{"country": "US", "plan": "pro"}properties->>'$.key' in SQL to extract values/mp-inspect keys to see all available property keysChain suggestions:
/mp-inspect keys <table-name>/mp-inspect column <table-name> <column-name>/mp-query sql to analyze dataShow event counts, unique users, and date ranges for each event in a table.
$2 if provided!$(mp inspect breakdown -t "<table-name>" --format table)
Output: For each event:
Chain suggestions:
/mp-query sql with WHERE clause/mp-funnel with discovered events/mp-inspect daily <event-name>Show all unique JSON property keys in a table, optionally filtered by event.
$2 if provided, otherwise ask-e flag to filter by specific eventAll events:
!$(mp inspect keys -t "<table-name>" --format table)
Specific event:
!$(mp inspect keys -t "<table-name>" -e "<event-name>" --format table)
Output: List of property keys found in the JSON properties column.
Using property keys in SQL:
-- Extract property value
SELECT properties->>'$.country' as country FROM events
-- Filter by property
SELECT * FROM events WHERE properties->>'$.plan' = 'pro'
-- Aggregate by property
SELECT
properties->>'$.country' as country,
COUNT(*) as events
FROM events
GROUP BY 1
Chain suggestions:
/mp-inspect column with property path/mp-inspect distribution <property-name>/mp-query sql with properties->>'$.key' syntaxPerform deep statistical analysis on a specific column.
properties->>'$.country')Simple column:
!$(mp inspect column -t "<table-name>" -c "<column-name>" --format table)
JSON property:
!$(mp inspect column -t "<table-name>" -c "properties->>'$.country'" --top 20 --format table)
Output:
Chain suggestions:
/mp-query segmentation --on <property>Analyze value distribution for a property using JQL (JavaScript Query Language).
country, plan, device_type)--from and --to flags!$(mp query jql - --from <from-date> --to <to-date> << 'EOF'
function main() {
return Events({
from_date: params.from_date,
to_date: params.to_date
})
.groupBy(['properties.<property-name>'], mixpanel.reducer.count())
.sortDesc('value');
}
EOF
)
Output: Property values with counts and percentages.
Chain suggestions:
/mp-fetch with WHERE clause on high-value properties/mp-query sql for complex queries/mp-query segmentation --on <property> for time-seriesShow daily event counts over time using JQL.
-e flag)--from and --to flagsAll events:
!$(mp query jql - --from <from-date> --to <to-date> << 'EOF'
function main() {
return Events({
from_date: params.from_date,
to_date: params.to_date
})
.groupBy(['day'], mixpanel.reducer.count())
.sortAsc('key.0');
}
EOF
)
Specific event:
!$(mp query jql - --from <from-date> --to <to-date> << 'EOF'
function main() {
return Events({
from_date: params.from_date,
to_date: params.to_date,
event_selectors: [{event: '<event-name>'}]
})
.groupBy(['day'], mixpanel.reducer.count())
.sortAsc('key.0');
}
EOF
)
Output: Daily counts showing trends and patterns.
Chain suggestions:
/mp-query segmentation with property breakdown/mp-fetch for date range with high activity/mp-retention to analyze user retentionAfter inspecting your data:
/mp-fetch to get them locally/mp-query to execute SQL or JQL queries/mp-funnel for conversion analysis/mp-retention for user retention curves/mp-report to generate comprehensive analysisIf mp auth test fails:
/mp-auth to setup credentials firstIf mp inspect tables shows no tables:
/mp-fetch to fetch data firstIf inspection fails with "not found":
/mp-inspect properties -e <event>/mp-inspect events to see all available eventsIf distribution/daily operations timeout:
/mp-fetch