Skip to main content
Glama

Investigate Cost Anomaly

investigate_anomaly
Read-only

Deep-dive a single service to investigate a cost anomaly. Anomalies are derived per provider scope: pass provider ("aws", "azure", "gcp", "snowflake", "anthropic", or "openai") to investigate that provider's spend — all chained calls follow the same scope. When provider is OMITTED the chained backend defaults differ (the anomalies trend spans all cloud providers, while the resource/daily drill-downs default to AWS), so pass provider explicitly for non-AWS services. Chains three read calls: (1) the anomalies view for the service's weekly trend and month-over-month comparison, (2) the per-resource breakdown for that service on a specific date (which resources/operations drive the spend), and (3) the ±7-day daily cost series from the overview. Returns a synthesized investigation: the MoM row, the weekly trend, the top resources by cost, the daily series, and a brief computed verdict on whether the trend looks anomalous. Provide service (required, provider-native name); date defaults to the current MoM period end; optionally scope to an account_id. RELATED: get_resource_breakdown exposes step (2) on its own — use it when you already know the service and date and just want the resource list (it also lets you narrow the window to a single day with granularity="daily"); use THIS tool when you want the trend and a verdict too. Read-only — never modifies anything. Example: { "service": "AmazonRDS", "date": "2026-06-15", "top_n_resources": 10 } investigates AWS RDS spend on that date; add "provider": "azure" to investigate an Azure service instead.

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": {
      "service": "<service>"
    },
    "name": "investigate_anomaly"
  }
}

Input Schema

NameRequiredDescriptionDefault
dateNoAnchor date (YYYY-MM-DD) for the per-resource breakdown and the ±7-day daily window. When omitted it is resolved in order: the anomalies MoM current-period end → the service's latest weekly slice → today (UTC). The resource breakdown REQUIRES a date, so one is always resolved.
serviceYesThe service to investigate, by its provider-native name (e.g. "AmazonRDS", "AmazonEC2" on AWS). REQUIRED — drives every chained call.
providerNoProvider scope for the anomaly data: "aws", "azure", "gcp", "snowflake", "anthropic", or "openai". OMIT = every connected provider combined (the backend default for the anomalies view). Pass a provider to analyze only that provider's cost movement. One provider per call.
account_idNoOptionally scope the per-resource rows to a single linked account (by account name).
response_formatNoconcise = synthesized investigation (trend, top resources, daily series, verdict). detailed = additionally the raw payloads from each chained call.concise
top_n_resourcesNoHow many top resources (by current cost) to include from the breakdown (default 15).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Beyond the readOnlyHint and openWorldHint annotations, the description discloses that this chains three read calls, describes what each chained call fetches, explains provider-scope propagation, and notes that omitted provider produces different backend defaults for the anomalies trend versus resource/daily drill-downs. It also states the return is a synthesized investigation with a computed verdict, and that the tool never modifies anything.

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 long but front-loaded: it states the purpose, then provider scope, then the three chained calls, then return shape, parameters, related tool, and an example. The numbered chain and RELATED section aid scanning. It is slightly verbose and repeats read-only behavior already covered by annotations, but every major sentence contributes useful context.

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?

This is a complex chained tool with six parameters, no output schema, and open-world behavior. The description explains what is returned, how provider scope affects each chained call, how date resolution works, how it differs from the closest sibling, and gives a concrete example. An agent has enough information to invoke it correctly without opening the schema.

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

Parameters4/5

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

Schema description coverage is already 100%, so the baseline is 3. The description adds meaningful nuance beyond the schema, especially the omitted-provider default divergence across chained calls, the provider-native service naming, the date fallback behavior, and a concrete example showing service, date, top_n_resources, and provider. It does not add much for account_id beyond the schema, but the provider and service guidance is substantive.

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 and resource: 'Deep-dive a single service to investigate a cost anomaly.' It explicitly distinguishes this synthesized investigation from get_resource_breakdown, which exposes only the per-resource step. An agent can tell exactly what this tool does and how it differs from the sibling.

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

Usage Guidelines5/5

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

It gives explicit when-to-use guidance versus get_resource_breakdown: use that tool when you already know the service and date and only want the resource list, and use this tool when you want the trend and a verdict too. It also warns to pass 'provider' explicitly for non-AWS services because omitted-provider defaults differ across chained calls. No significant usage gap remains.

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