Skip to main content
Glama

finance

Analytics: Get spending anomalies

get_spending_anomalies
Read-onlyIdempotent
    Detect categories with unusually high spending this month.

    Compares current month spending to recent monthly averages.
    Flags categories where spending exceeds the threshold multiplier.

    Args:
        months_lookback: Number of months for computing averages (default 3)
        threshold: Multiplier threshold (default 2.0 = 2x the average)

    Returns:
        List of anomalies with category, current amount, average,
        ratio, and severity (high/medium).
    

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
thresholdNo
months_lookbackNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true and idempotentHint=true, so safety is covered. The description adds value by explaining the comparison logic, the threshold interpretation, and the return fields (category, current amount, average, ratio, severity). This is meaningful behavioral context beyond the annotations.

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?

The description is compact and well-structured with clear sections for Args and Returns. Every sentence conveys necessary information—purpose, algorithm, parameter semantics, and output shape—with no redundancy or filler.

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 a read-only analytics tool with two optional parameters and no output schema, the description is quite complete. It documents both parameters with meanings and defaults, and describes the return list fields. Minor gaps remain (e.g., exact calendar-month definition, empty-result behavior), but these are not critical for calling the tool correctly.

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

Parameters5/5

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

Schema coverage is 0%, so the description carries the full burden. It explains months_lookback as 'Number of months for computing averages (default 3)' and threshold as 'Multiplier threshold (default 2.0 = 2x the average)', adding exactly the semantic meaning the schema lacks. The defaults are also stated in clear prose.

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 opens with a specific verb+resource: 'Detect categories with unusually high spending this month.' This clearly distinguishes it from sibling analytics tools like get_spending_summary or get_category_trend by focusing on anomaly detection rather than summaries or trends.

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?

The description makes the use case explicit: detecting categories with unusually high spending compared to recent averages. It does not name alternatives or give exclusions, but the algorithm description ('compares current month spending to recent monthly averages') gives clear contextual guidance on when this tool is appropriate.

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