Skip to main content
Glama
Pauesome

Ads Analytics MCP

by Pauesome

get_meta_anomaly_signal

Detect daily Meta campaign performance anomalies with a rolling-baseline Z-score model, flagging spikes or drops in CTR, CPM, CPC, CPA, spend, and conversions for quick triage.

Instructions

Detects daily anomalies in Meta campaign performance using a rolling-baseline Z-score model — equivalent in intent to Meta's MCP ads_insights_anomaly_signal but computed locally from /insights daily data (no new endpoint). For each campaign × metric (CTR, CPM, CPC, CPA, spend, conversions), evaluates the trailing days against a baseline of the prior baseline_days (default 14). Flags any day with |z| ≥ z_threshold (default 2.0). Severity: |z| ≥ 2× threshold = severe, ≥ 1.5× = moderate, otherwise mild. Direction: spike vs drop. Sorted severity → most-recent → |z|. Use to triage 'something changed yesterday' before doing a full audit.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
metricsNoSubset of metrics to evaluate. Defaults to all six when omitted.
client_idNoClient identifier.
z_thresholdNoAbsolute Z-score threshold to flag a daily bucket. Default 2.0. Min 1, max 5.
campaign_idsNoFilter to specific campaign IDs.
baseline_daysNoRolling baseline window in days. Default 14. Min 7, max 60.
ad_account_idsNoOverride the client's default Meta ad account IDs.
date_range_endNoYYYY-MM-DD. Defaults to today.
date_range_startNoYYYY-MM-DD. Defaults to baseline_days + 14 days ago.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.3/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It discloses the algorithm (rolling-baseline Z-score), the per-campaign-metric evaluation scope, severity banding (severe/moderate/mild based on multiples of threshold), direction (spike vs drop), and output ordering (severity → recency → |z|). It does not state auth requirements, rate limits, or computational cost, but the behavioral disclosure is unusually rich for an analysis tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the core purpose and carries dense technical detail in a few sentences. Every sentence contributes to understanding the algorithm or usage. Slightly long but justified by the complexity of the detection model; no obvious padding.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For an analysis tool with 8 parameters, 100% schema coverage, no output schema, and no annotations, the description supplies the algorithmic context an agent needs to interpret results (what a flag means, severity levels, sorting). It does not describe the return format (list of anomalies with fields), which would help, but the core call-time context is complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the schema already documents all 8 parameters with defaults, ranges, and formats. The description adds semantic meaning by explaining what baseline_days and z_threshold do in the algorithm (trailing days vs prior baseline, flagging threshold), which is helpful context beyond the schema's terse descriptions. Baseline 3 is appropriate when the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb+resource ('Detects daily anomalies in Meta campaign performance') and immediately distinguishes itself from the closest sibling by referencing Meta's MCP ads_insights_anomaly_signal and clarifying it is computed locally. An agent can differentiate this from get_meta_campaign_performance and get_tiktok_anomaly_signal without opening schemas.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly states the use case at the end: 'Use to triage something changed yesterday before doing a full audit.' It also names the equivalent MCP tool, effectively routing the agent between local and remote anomaly detection. When-to-use is clear; when-not-to-use is implied by 'before doing a full audit.'

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.