Skip to main content
Glama

analyze_spending_trends

Analyze historical spending by day, week, or month to uncover patterns and detect anomalies. Use date ranges and granularity to guide FinOps cost reviews.

Instructions

Analyze historical spending trends by day, week, or month to identify patterns and anomalies.

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": {
      "start_date": "<start_date>",
      "end_date": "<end_date>"
    },
    "name": "analyze_spending_trends"
  }
}

Input Schema

NameRequiredDescriptionDefault
end_dateYesEnd date for trend analysis in YYYY-MM-DD format
start_dateYesStart date for trend analysis in YYYY-MM-DD format
granularityNoTime granularity for trend analysis (default: daily)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

B3.1/5.0
Behavior2/5

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

No annotations are supplied, so the description carries the full disclosure burden. It implies a read-only analytical operation and mentions detecting anomalies, but says nothing about data scope, date-range limits, rollup rules for incomplete periods, or what the result contains.

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?

A single front-loaded sentence with no filler or redundancy. It is efficient, though its brevity is part of why behavioral detail is thin rather than a model of density.

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

Completeness2/5

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

For a parameterized analytical tool with no annotations and no output schema, the description should explain what comes back (series, anomaly list, aggregation rules). Instead it stops at the purpose, leaving the agent to guess at the response shape and limits.

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 start_date, end_date, and granularity are already fully documented in the schema. The phrase "by day, week, or month" merely restates the granularity enum with no added semantics such as default behavior or date-boundary handling.

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?

The description gives a specific verb and resource ("Analyze historical spending trends") plus the granularity axis (day/week/month) and stated aim (patterns and anomalies). This clearly separates it from a cost-forecasting sibling, but it never names or contrasts an alternative, so it stops short of a 5.

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

Usage Guidelines3/5

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

The word "historical" implicitly signals retrospective analysis rather than forecasting, which is a useful cue, but there is no explicit when-to-use, when-not-to-use, or named alternative (e.g. forecast_costs or analyze_cost_by_tag). Guidance is only implied.

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