Skip to main content
Glama

Get Weekly Cost Slices

get_weekly_cost_slices
Read-only

Return weekly per-service cost slices (weeklyByServiceLast12) plus the month-over-month by-service comparison from the cost-dashboard anomalies view, for the trailing ~12+ weeks. The data is scoped per provider: OMIT provider for all cloud providers combined (AWS + Azure + GCP — the backend default), or pass "aws", "azure", "gcp", "snowflake", "anthropic", or "openai" to get one provider's weekly slices instead. Use this to chart spend trends and spot week-over-week or month-over-month swings. Filter with service and/or account_id; cap with limit (newest weeks first). Read-only — never modifies anything. Example: { "provider": "azure", "limit": 100 } returns Azure weekly per-service costs; { "service": "AmazonRDS" } returns the AWS RDS trend and its MoM baseline-vs-current comparison.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "get_weekly_cost_slices"
  }
}

Input Schema

NameRequiredDescriptionDefault
limitNoMax weekly slice rows to return after filtering (default 500). Newest weeks first.
serviceNoFilter the weekly slices to a single service by its provider-native name (e.g. "AmazonRDS", "AmazonEC2" on AWS). Matches the `awsService` field exactly (a legacy field name — under a non-AWS provider scope it carries that provider's service names).
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_idNoFilter to a single linked AWS account (by account name as the payload exposes it). Note: by-service weekly rollup rows often carry a null account.
response_formatNoconcise = the weekly slices + the MoM-by-service comparison (default). detailed = the full parsed anomalies payload (the weekly slices still honor service/account_id/limit).concise

Output Schema

NameRequiredDescriptionDefault
toolNoWhich tool truncated (only on a truncated result).
filtersNoThe service / account filters applied.
messageNoHow to narrow the request (only on a truncated result).
currencyNoThe organization's display currency.
momPeriodNoThe month-over-month comparison window { start, end }.
truncatedNoPresent and true when the result exceeded the output-size budget and was WITHHELD. When you see this, no data fields are present — narrow the request as `message` says and call again.
lastUpdatedNoWhen the underlying cost data was last ingested.
approx_charsNoApproximate size of the withheld result (only on a truncated result).
momByServiceNoPer-service month-over-month rows — `service`, `baselineAvg`, `currentCost`, `pctChange`.
weeklySlicesNoWeekly per-service rows — `week`, `accountName`, `awsService`, `totalCost` — newest first.
providerScopeNoThe provider scope, or "all".
returnedSlicesNoHow many were returned.
weeklySliceCountNoHow many slices matched before `limit`.
weeklyByServiceLast12NoThe same filtered + capped slices, on the full payload (detailed only).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true, so the 'Read-only — never modifies anything' line is confirmatory. The description adds real behavioral context beyond annotations: the backend default when provider is omitted, the one-provider-per-call constraint, newest-weeks-first ordering, and that by-service rollup rows often carry a null account.

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 core scope and provider decision are front-loaded, followed by filtering/limit guidance and two illustrative examples. It is dense but not padded; some phrasing overlaps with what the schema already states, keeping it short of ideal.

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 an output schema covering return values and annotations covering the safety profile, the description supplies everything else an agent needs: provider scoping rules, filter dimensions, limit semantics, time window, and worked examples. Nothing required for correct invocation is missing.

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%, so the schema already documents limit, service, provider, account_id, and response_format in depth. The description adds only marginal meaning beyond that — enumerating AWS+Azure+GCP for the default scope and giving concrete example invocations — which is a fair baseline-3 contribution.

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: returns weekly per-service cost slices (`weeklyByServiceLast12`) plus the month-over-month by-service comparison from the anomalies view, over a trailing ~12+ week window. An agent can distinguish this trend/charting tool from siblings like get_cost_pivot or get_resource_breakdown without opening the schema.

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?

Clear usage context: chart spend trends, spot week-over-week or month-over-month swings, and narrow with `service`/`account_id`/`limit`. It also spells out the provider scoping decision (omit for combined, pass one of six values). It stops short of explicitly naming a sibling alternative or stating when NOT to use this versus a pivot/breakdown tool.

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