Agent Analytics now reads Core Web Vitals and grouped JS errors
Your agent reads p50, p75, and p95 of LCP, CLS, INP, FCP, and TTFB, plus grouped $error events, through the hosted MCP server or the CLI.
Agent Analytics now returns Core Web Vitals percentiles and grouped JavaScript errors straight to your agent. Shipped 2026-11-12. The agent reads p50, p75, and p95, sees which error is hitting people, decides what to fix, and runs the same read again. The loop stays in the agent. There is no dashboard to open.
Connect the hosted MCP server first: https://mcp.agentanalytics.sh/mcp. Ask in chat. The CLI is the same read for a coding agent that already has a shell: @agent-analytics/cli@0.5.41.

Where the numbers come from
New installs include data-track-vitals="true" in the default snippet, so vitals are on by default for new installs. On hosted Agent Analytics they are stored as cwv_* properties on page_view: cwv_lcp, cwv_inp, cwv_cls, cwv_fcp, and cwv_ttfb. Agents read them with the vitals read (web_vitals on MCP, vitals on the CLI): p75, rated good, needs-improvement, or poor on the web.dev thresholds. Self-hosted core stores the same keys on a $web_vitals event. $error events come from data-track-errors. Collection is covered in What’s New in Tracker.js.
The MCP tool properties_received lists the keys on page_view. If a percentile row comes back with n 0, the event filter is on the wrong event.
Ask through MCP
Replace my-site with your project name. Sign in when the connect card appears.
Connect the Agent Analytics MCP server at https://mcp.agentanalytics.sh/mcp. When it asks me to sign in, wait for me. Then call properties_received on my-site and confirm page_view carries cwv_lcp, cwv_inp, cwv_cls, cwv_fcp, and cwv_ttfb.
On my-site, call query for the last 7 days. Filter event to page_view. Set property to cwv_lcp and metrics to p50, p75, and p95. Return n and skipped. Then do the same for cwv_inp, cwv_cls, cwv_fcp, and cwv_ttfb.
On my-site, call errors with since 7d and limit 20. For each group, give message, source, line, count, users, sessions, and top_paths. Say whether approximate is true.
query and errors are Pro reads on POST /query and GET /errors. A free account gets HTTP 403 PRO_REQUIRED, and that rejection is not metered. One successful call counts as one metered read.
query takes project, metrics, property, filters, group_by, date_from, date_to, order_by, order, and limit. Numeric metrics are sum, avg, p50, p75, and p95. property is required for those metrics. Pass the key alone, such as cwv_lcp. Only JSON numbers are aggregated. Each row adds n and skipped. percentile_method is nearest_rank when a percentile is requested, and null when the aggregation is only sum or avg. group_by is event, date, user_id, session_id, or country.
errors takes project, since (default 7d), until (default today UTC), new_since, and limit (default 20, max 100). The group key is a SHA-256 fingerprint of the normalized message, the source filename, and the numeric line. The tracker does not send a stack, and col is not part of the key. Each group includes fingerprint, a sample message, source, line, count, users, sessions, first_seen, last_seen, and up to 3 top_paths. Every response includes approximate. When approximate is true, caps lists the scan caps that were hit: distinct_triples and window_rows.
The kind of answer you want
Example output, sample project. The numbers below are made up.
sample-project, last 7 days
event: page_view
property: cwv_lcp
percentile_method: nearest_rank
p50 1800
p75 2400
p95 4100
n 120
skipped 4
Errors: sample-project
Since: 2026-11-05 to 2026-11-12
Limit: 20
approximate: false
Cannot read properties of undefined (reading 'map')
6 events 4 users 5 sessions
source: app.js line: 42
paths: /checkout, /pricing
CLI, when the agent has a shell
npx --yes @agent-analytics/cli@0.5.41 query my-site --metrics p50,p75,p95 --property cwv_lcp --filter '[{"field":"event","op":"eq","value":"page_view"}]' --days 7
Hosted Agent Analytics stores these keys on page_view. Self-hosted core stores them on $web_vitals.
query flags: --metrics, --property, --group-by, --filter, --from, --to, --days, --count-mode, --order-by, --order, --limit, --email. --metrics accepts event_count, unique_users, session_count, bounce_rate, avg_duration, sum, avg, p50, p75, p95. --property is required with sum, avg, p50, p75, or p95.
For a dated ship, compare can measure a vital. It stays a free read. Lower is better for these keys. --metric is sum(key), avg(key), p50(key), p75(key), or p95(key). --metric-event defaults to the goal event. --better defaults to higher. In v1 a metric compare returns extend, with reason no_interval_for_metric when lift meets a threshold.
npx --yes @agent-analytics/cli@0.5.41 compare my-site --goal signup --metric 'p75(cwv_lcp)' --metric-event page_view --better lower --ship-date 2026-11-05 --days 7
Grouped errors:
npx --yes @agent-analytics/cli@0.5.41 errors my-site --since 7d --new-since 2026-11-12
errors flags: --since (7d or YYYY-MM-DD, default 7d), --until (YYYY-MM-DD), --new-since (a date or an annotation title), --limit (default 20, max 100), --json.
What the agent does next
- Read p50, p75, and p95 of
cwv_lcp,cwv_inp,cwv_cls,cwv_fcp, andcwv_ttfbonpage_view. - Read grouped
$errorevents for the same window. Open the path on the group with the highest count. - Change that page or that line.
- Run the same
queryanderrorscalls again.
Docs
- CLI: query metrics and the errors command.
- API reference:
POST /queryandGET /errors. - Tracker.js:
cwv_*onpage_viewfor hosted,$web_vitalson self-hosted, and$error. - What’s New in Tracker.js: how the tracker collects vitals and errors.
- MCP server:
https://mcp.agentanalytics.sh/mcp. Tools:web_vitals,query,errors,properties_received.