Skip to main content
Glama

Find Anomalies

find_anomalies
Read-onlyIdempotent

Flag days whose metric value deviates more than threshold_sigma standard deviations from the rolling-window mean. Default window 90 days, default threshold 2σ. Use when the user asks 'when did my HRV crash?' or 'pick out my worst sleep weeks'. Returns empty list (and insufficient_baseline=true) if fewer than 14 non-null days. Pass user's LOCAL end_date as strict YYYY-MM-DD.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "metric": "<metric>",
      "end_date": "<end_date>"
    },
    "name": "find_anomalies"
  }
}

Input Schema

NameRequiredDescriptionDefault
metricYesMetric to scan for outliers.
end_dateYesEnd of window YYYY-MM-DD, user's LOCAL date (inclusive).
lookback_daysNoWindow size in days, 7-365. Default 90.
threshold_sigmaNoZ-score magnitude that qualifies as an anomaly. Default 2.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
  2. Changed1 schema field changed
    • changedInput schema / properties / metric / enum
      Previous value: -[
      -  "sleep_score",
      -  "readiness_score",
      -  "activity_score",
      -  "hrv",
      -  "resting_hr",
      -  "steps",
      -  "total_sleep_hours",
      -  "efficiency_pct"
      -]New value: +[
      +  "sleep_score",
      +  "readiness_score",
      +  "activity_score",
      +  "hrv",
      +  "resting_hr",
      +  "steps",
      +  "active_calories",
      +  "total_calories",
      +  "total_sleep_hours",
      +  "efficiency_pct"
      +]
  3. First observed

TDQS

A4/5.0
Behavior4/5

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

Annotations already declare readOnly/idempotent/openWorld, so safety is covered. The description adds genuinely new behavior: empty list plus insufficient_baseline=true when fewer than 14 non-null days exist, and the defaults (90-day window, 2σ). It does not say what each returned day record contains, but with no output schema this is a modest, not fatal, gap.

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

Conciseness5/5

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

Four tight sentences with zero filler: mechanism first, usage examples second, edge-case return behavior third, timezone caveat last. Nothing is redundant with the enum list or restates the tool name.

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?

With no output schema, the description carries the return-value burden and does disclose the key success and failure shapes (list of anomalous days, or empty list with insufficient_baseline=true). What fields each anomalous day carries is left unspecified, which is the one remaining gap for an agent scoring 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 coverage is 100%, so the schema already documents all four parameters, including the local-date constraint and defaults. The description restates the window and threshold defaults and re-emphasizes the LOCAL date format, which is reinforcement rather than new semantics. Baseline 3 applies.

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

Purpose4/5

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

States a precise operation: flag days whose metric deviates more than threshold_sigma standard deviations from the rolling-window mean. The statistical method is spelled out, making the output shape inferable. It does not name the closest sibling (compare_to_baseline), which handles a similar baseline-comparison question, so the agent must infer the boundary itself.

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?

Gives concrete trigger phrasings ('when did my HRV crash?', 'pick out my worst sleep weeks') that make the intended question type obvious, plus an implicit when-not condition via the insufficient-baseline case. No explicit exclusion relative to compare_to_baseline, which is the main ambiguity an agent would face.

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