Skip to main content
Glama

aws_ce_get_cost_and_usage

Retrieve AWS cost and usage data for specified time periods. Group results by service, account, region, or tags to analyze spending patterns and optimize cloud expenses.

Instructions

Get cost and usage data for a time period. Group by service, account, region, tag, etc. TimePeriod format: {'Start': 'YYYY-MM-DD', 'End': 'YYYY-MM-DD'}.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
profileNoAWS profile name from ~/.aws/config (e.g., 'default', 'production')
regionNoAWS region override (e.g., 'us-east-1', 'sa-east-1')
time_periodYesTime period for the cost query
granularityNoTime granularity (default: MONTHLY)
metricsNoMetrics to return (default: ['UnblendedCost']). Options: UnblendedCost, BlendedCost, AmortizedCost, UsageQuantity
group_byNoGroup results by dimension (e.g., [{"Type": "DIMENSION", "Key": "SERVICE"}])
filterNoCost Explorer filter expression
Behavior3/5

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

With no annotations provided, the description carries the full burden. It provides valuable behavioral context by specifying the exact TimePeriod JSON format required. However, it omits critical operational details like read-only safety, API rate limits, or pagination behavior for large result sets.

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 two-sentence structure is efficient and front-loaded. The first sentence establishes scope; the second provides essential syntax guidance. Every sentence earns its place with no redundancy, though a brief mention of AWS Cost Explorer context could strengthen it slightly.

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

Completeness3/5

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

Given the complex nested parameters (group_by filters, time_period objects) and absence of an output schema, the description is minimally complete. It hints at grouping behavior but should explicitly state what data structure is returned (e.g., time-ordered cost records) to fully compensate for the missing output 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?

Despite 100% schema description coverage, the description adds crucial value by providing the concrete TimePeriod format example {'Start': 'YYYY-MM-DD', 'End': 'YYYY-MM-DD'}, which clarifies the nested object structure better than the schema alone. This significantly aids correct invocation.

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 clearly states the tool retrieves 'cost and usage data for a time period' with specific grouping capabilities. However, it fails to distinguish this historical data tool from the sibling 'aws_ce_get_cost_forecast' (forecast vs actual spending), which is relevant given both are Cost Explorer tools.

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

Usage Guidelines2/5

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

The description lacks any guidance on when to use this tool versus alternatives, particularly the sibling forecast tool. It does not mention prerequisites like required AWS permissions (ce:GetCostAndUsage) or cost/usage limits for queries.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/marcelobrake/aws-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server