You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add an MCP tool get_visibility_trend (+ /api/mcp/visibility-trend REST) returning a brand's visibility over time (time-series by day/week for a date range) — complementing the point-in-time get_visibility_summary.
Why
MCP clients and the planned in-product assistant (#94) need trend data to answer "how has my visibility changed over the last 30 days?" and to render charts. The current get_visibility_summary is only a snapshot.
Data source
prompt_results aggregated over time per brand. The insights layer already computes visibility in tracking.ts (getInsightsSummary). A trend tool buckets visibility_score / mentions / citations by day within a range. Aggregate in the DB (see #93) rather than fetching all rows + JS reduce.
Where to change (existing MCP pattern)
web/src/lib/mcp/data.ts: getVisibilityTrendFor(auth, { brandId, from, to, granularity }) — org-ownership check first (return null → 404), then DB-aggregated series.
Activity
feat(mcp): expose get_visibility_trend tool (visibility time-series) …