Explain Performance Anomaly
Explain why a performance metric changed using statistical analysis and historical context.
β οΈ IMPORTANT: This tool retrieves READ-ONLY data. Safe to call multiple times. Uses statistical analysis only (no ML models).
π― What This Tool Does (Performance Agent - Phase 1 Feature 4):
- Explains why metrics changed (ROAS, CTR, CPC, conversions, conversion rate)
- Compares current period to historical averages (30/60/90-day)
- Identifies contributing factors with severity levels
- Detects campaign changes (paused, new, budget changes)
- Finds similar historical periods (seasonality detection)
- Provides actionable recommendations to address issues
Returns comprehensive anomaly explanation:
- Current metric value vs historical averages
- Deviation percentages (how much it changed)
- Contributing factors:
- CPC changes (>15% = auction competition shifts)
- Conversion rate changes (>10% = landing page/seasonality issues)
- Campaign changes (paused high-performers, new campaigns, budget changes)
- Day-of-week patterns (weekend vs weekday effects)
- Similar historical periods for context
- Assessment (normal variation vs requires action)
- Specific recommendations to fix the issue
π How Anomaly Detection Works:
Historical Comparison:
- Compares current period to 30/60/90-day averages
- Β±15% deviation considered βnormal variationβ
-
15% deviation flagged as requiring attention
Contributing Factor Detection:
-
CPC Changes (>15% threshold)
- Increased CPC = auction competition increased
- Decreased CPC = auction competition decreased or bid adjustments
-
Conversion Rate Changes (>10% threshold)
- Decreased = landing page issues, seasonality, audience quality
- Increased = landing page improved, better targeting
-
Campaign Changes:
- Paused high-performers (ROAS > 3.0x) = lost revenue driver
- New campaigns (>$1K spend) = learning phase affecting overall performance
- Budget changes (>20%) = delivery and auction participation affected
-
Day-of-Week Patterns:
- Weekend-heavy periods often show different performance
- Normal for B2C (higher weekend conversion)
- Normal for B2B (lower weekend conversion)
-
Seasonality Detection:
- Finds similar historical periods (Β±10% metric value)
- Helps identify if drop is seasonal vs real issue
Parameters:
- metric: βroasβ, βctrβ, βcpcβ, βconversionsβ, βconversion_rateβ (REQUIRED)
- period_start: Start date in YYYY-MM-DD format (REQUIRED)
- period_end: End date in YYYY-MM-DD format (REQUIRED, max 30 days period)
- customer_id: Optional (uses connected account if omitted)
Execution time: 2-4 seconds (statistical analysis + database queries) Data source: campaign_daily_metrics table (updated nightly, 120-day retention) Analysis method: Statistical comparison (no ML models) Trigger: Reactive (user asks βwhy?β), not proactive alerts
Use this tool when:
- User asks βwhy did my ROAS drop?β
- User asks βwhy did my CTR increase?β
- User notices unexpected metric changes
- User wants to understand performance fluctuations
- After seeing performance changes in dashboards
π AFTER calling this tool, help the user understand:
Normal vs Abnormal Variation:
- Normal: Β±15% deviation, typical day-of-week/seasonal patterns
- Abnormal: >15% deviation with specific contributing factors
Severity Levels:
- π΄ HIGH: >25% change with clear cause (CPC spike, campaign paused)
- π‘ MEDIUM: 15-25% change or multiple minor factors
- π’ LOW:
<15% change, likely normal variation
Example Interpretation: βYour ROAS dropped 33% from 4.2x to 2.8x. This was caused by two high-severity factors:
- CPC increased 25% (auction competition spike during holiday season)
- Your top campaign βBrand - Exactβ was paused, losing $240/day in high-ROAS revenue
This is NOT normal variation - these are actionable issues. Recommendations:
- Reduce bids by 10-15% to counter CPC inflation
- Re-enable βBrand - Exactβ campaign if budget allows
- Review landing page conversion rate (also dropped 12%)β
Similar Period Context: If tool finds similar historical periods, explain seasonality: βYour ROAS was similarly low (2.7x) on December 18, 2024, which was also during the holiday shopping season. This suggests some of the drop is seasonal, but the campaign pause is amplifying the effect.β
Quick Actions: Based on contributing factors, prioritize:
- Campaign paused β Re-enable high performers immediately
- CPC spike β Adjust bids, improve Quality Score
- Conversion rate drop β Review landing page, check for bugs
- Budget changes β Monitor delivery as it stabilizes
- Weekend effect β Normal variation, no action needed
Visualization Tip: Suggest creating a line chart showing the metric over time with 30-day average band and annotations for detected factors (e.g., βCampaign paused hereβ, βCPC spike started hereβ).
Important Notes:
- This is REACTIVE explanation, not proactive monitoring
- Max 120-day historical lookback (database retention limit)
- Uses simple statistics (mean, variance), no ML predictions
- Focus on actionable factors user can control
- Consider seasonality when interpreting results
Best Practices:
- Run this tool when you notice >15% metric changes
- Compare multiple time periods to confirm trends
- Cross-reference with other tools (wasted spend, budget optimizer)
- Use for post-mortem analysis of performance changes
- Help user distinguish normal variation from real issues
π¬ Community: For anomaly analysis discussions, visit our Discord: https://discord.gg/dH3Qt4YS
Authorizations
API key from https://adspirer.ai/keys. Prefix sk_live_. Treat as a secret β never commit.
Headers
Client-generated UUID to make writes idempotent. Strongly recommended for write tools. A repeat call with the same key returns the cached result instead of re-executing. Example: 550e8400-e29b-41d4-a716-446655440000
Body
All tool arguments are wrapped in an arguments object. The fields accepted inside arguments are listed below β required fields are marked with a red asterisk.
Input schema for performance anomaly explanation
Response
Tool executed successfully. data.text carries the human-readable result (markdown-friendly). data.quota shows your current usage against the plan limit. data.structured appears when the tool emits machine-parseable structured content. data.content appears for tools that return non-text blocks (images, resources).
Returned on HTTP 200. data.text is the primary human-readable output. data.quota is always present for billable calls. data.structured is set only when the tool emits machine-parseable structured content. data.content is set only when the tool emits non-text content blocks.

