Skip to main content
Glama

get_anomalies

Anomaly detection across revenue, conversion rate, and refund rate for each of your stores (works for a single store too). Compares the most recent 7-day window against the prior 4 weeks and flags moves outside +/- 1.5 standard deviations or 25% — whichever is stricter. Returns ranked anomalies with store, metric, current vs baseline, severity, and a one-line explanation. High-severity anomalies carry EITHER drivers+driverSummary (the tag/source/country slice that drove the move) OR driversNote (attribution ran, the move is broad-based — sitewide cause, not one channel), plus an investigate block: the exact next tool call WITH the anomaly's own window. USE investigate VERBATIM — the target tool's default 30-day window will NOT show a one-week move. Use as a session opener: 'anything weird happening?'.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
_offsetNoPagination offset. If a response includes _pagination.hasMore=true, use _offset to fetch the next page.
lookbackWeeksNoHow many prior weeks to use as baseline (default 4).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added
  2. Removed
  3. Added

TDQS

A4.4/5.0
Behavior5/5

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

With no annotations provided, the description carries the full behavioral burden and does so well: it discloses the detection method and thresholds, the ranked output fields, the mutually exclusive drivers/driverSummary vs driversNote semantics (with the interpretation that driversNote means a sitewide, non-channel cause), and the required follow-up call pattern. This is far beyond what a bare 'detect anomalies' line would convey.

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-loads purpose before method and edge-case warnings, and the dense driver/investigate paragraph is high-value rather than filler. It is long, but nearly every clause (thresholds, driversNote semantics, verbatim-window warning) prevents a real invocation mistake.

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?

With no output schema and no annotations, the description compensates fully: it enumerates returned fields, explains the two attribution shapes, and describes the investigate handoff including why the target's default window fails. An agent has everything needed to call it and act on results.

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 description coverage is 100% and both parameters are self-documented, so the baseline is 3. The description only alludes to the baseline window ('prior 4 weeks'), which mirrors the lookbackWeeks default, and says nothing about _offset pagination beyond what the schema already states.

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 ('Anomaly detection across revenue, conversion rate, and refund rate') with explicit scope ('for each of your stores, works for a single store too'). The methodology sentence (7-day vs prior 4 weeks, +/- 1.5 SD or 25%) and return contents make it unmistakable versus siblings like get_weekly_trends or get_daily_metrics.

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?

Explicitly positions the tool as a session opener ('anything weird happening?') and warns that the target tool's default 30-day window will not surface a one-week move, instructing the agent to use `investigate` verbatim. It does not, however, name a competing tool to use instead when the agent wants trend confirmation rather than anomaly scanning.

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