Get Microsoft Clarity Insights
clarity_get_insightsFetch Microsoft Clarity traffic and engagement metrics for a connected project, with optional breakdowns by up to 3 dimensions. Track sessions, engagement time, scroll depth, and errors over 1-3 days.
Instructions
Fetch Microsoft Clarity's traffic and engagement metrics (sessions, bots, engagement time, scroll depth, rage clicks, quick backs, dead clicks, script errors, and more) for a connected Clarity project, optionally broken down by up to 3 dimensions.
Note: Clarity connections authenticate with a per-project API token generated in the Clarity dashboard (Settings > Data Export), not OAuth — Clarity's Data Export API does not support OAuth. Each token is capped at 10 requests/day; this tool caches results for 1 hour to help stay under that limit.
Args:
connection (string): Name of a configured Clarity connection
num_of_days (1 | 2 | 3): How many trailing days of data to fetch (Clarity only supports 1-3)
dimensions (string[], optional): Up to 3 of: Browser, Device, Country, OS, Source, Medium, Campaign, Channel, URL, PageTitle. Omit for totals with no breakdown.
response_format ('markdown' | 'json'): Output format (default: 'markdown')
Returns raw per-metric breakdowns as reported by Clarity, e.g. one entry per metric name ("Traffic", "EngagementTime", "ScrollDepth", "DeadClickCount", ...) each with an "information" array of rows for the requested dimension breakdown.
Use when: "How is Clarity engagement trending by device over the last 3 days?" -> dimensions=["Device"] Don't use when: You need historical data beyond 3 days (Clarity's export API doesn't support that; use the Clarity dashboard/UI instead).
Error Handling:
Returns "Clarity API rate limit reached" if the project's 10-requests/day cap is hit; wait and retry, or reuse a cached result.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| connection | Yes | ||
| dimensions | No | ||
| num_of_days | No | ||
| response_format | No | markdown |