Skip to main content
Glama

Trillboards DOOH Advertising

anomaly_detect

Detect anomalies in observation patterns. Alert when metrics deviate significantly from trailing averages.

Computes trailing mean and standard deviation for a given metric from the observation_stream, then identifies observations that fall beyond the configured sigma threshold (z-score based anomaly detection).

WHEN TO USE:

  • Monitoring for unusual audience patterns (sudden spikes or drops in face count)

  • Detecting equipment anomalies (confidence drops indicating sensor issues)

  • Identifying unusual commerce or vehicle patterns

  • Finding outlier moments that may indicate events, incidents, or opportunities

RETURNS:

  • anomalies: Array of anomalous observations with:

    • observation_id, device_id, venue_type, observed_at

    • metric_value: The observed value

    • z_score: How many standard deviations from the mean

    • direction: 'above' or 'below' the mean

    • payload: Full observation payload for context

  • baseline: { mean, stddev, sample_count, lookback_hours }

  • suggested_next_queries: Follow-up queries to investigate anomalies

EXAMPLE: User: "Are there any unusual audience patterns at retail venues?" anomaly_detect({ metric: "face_count", venue_type: "retail", lookback_hours: 24, threshold_sigma: 2.0 })

User: "Detect anomalies in vehicle counts at this screen" anomaly_detect({ metric: "vehicle_count", screen_id: "507f1f77bcf86cd799439011", lookback_hours: 48, threshold_sigma: 2.5 })

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
metricYesThe metric to check for anomalies. Extracted from observation payload (e.g., face_count, vehicle_count, confidence, emotional_engagement, crowd_energy, noise_level)
screen_idNoFilter to a specific screen (mongo ID). Optional.
venue_typeNoFilter to a specific venue type. Optional.
lookback_hoursNoHours of historical data to compute baseline from (default: 24, max: 168)
threshold_sigmaNoNumber of standard deviations to consider anomalous (default: 2.0, range: 1.0-5.0)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changed
    • addedInput schema / properties / lookback_hours / description
      Added value: +"Hours of historical data to compute baseline from (default: 24, max: 168)"
    • addedInput schema / properties / metric / description
      Added value: +"The metric to check for anomalies. Extracted from observation payload (e.g., face_count, vehicle_count, confidence, emotional_engagement, crowd_energy, noise_level)"
    • addedInput schema / properties / screen_id / description
      Added value: +"Filter to a specific screen (mongo ID). Optional."
    • addedInput schema / properties / threshold_sigma / description
      Added value: +"Number of standard deviations to consider anomalous (default: 2.0, range: 1.0-5.0)"
    • addedInput schema / properties / venue_type / description
      Added value: +"Filter to a specific venue type. Optional."
  2. Added

TDQS

A4.2/5.0
Behavior4/5

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

With no annotations provided, the description carries the full burden and does well: it discloses the algorithmic behavior (trailing mean/stddev, z-score), computes baseline statistics, and describes the return payload. It doesn't explicitly state side-effect safety, but the focus on detection and returns implies a read-only operation.

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?

The description is structured into clear sections (purpose, when to use, returns, examples) and every sentence contributes value. It is longer than average but appropriate given the tool's complexity and the absence of an output schema.

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

Completeness5/5

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

The description fully compensates for missing annotations and missing output schema by detailing return values, providing example invocations, and explaining the detection logic. It is complete enough for an agent to select and invoke the tool correctly.

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 baseline is 3. The description adds meaningful context beyond the schema by explaining how parameters like metric, lookback_hours, and threshold_sigma interact in examples, but it doesn't provide per-parameter semantics beyond what the schema already offers.

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?

The description uses a specific verb ('Detect anomalies') and clearly identifies the resource ('observation patterns'), making the tool's purpose explicit. It distinguishes from siblings like predictive_query by focusing on statistical outlier detection in observation data.

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

Usage Guidelines4/5

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

A dedicated 'WHEN TO USE' section lists concrete scenarios such as monitoring audience patterns and detecting equipment anomalies, providing clear usage context. It does not explicitly name alternative tools or state when not to use this tool, but the context is strong enough to guide selection.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources