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'}.
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": {
"time_period": "<time_period>"
},
"name": "aws_ce_get_cost_and_usage"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| profile | No | AWS profile name from ~/.aws/config (e.g., 'default', 'production') | |
| region | No | AWS region override (e.g., 'us-east-1', 'sa-east-1') | |
| time_period | Yes | Time period for the cost query | |
| granularity | No | Time granularity (default: MONTHLY) | |
| metrics | No | Metrics to return (default: ['UnblendedCost']). Options: UnblendedCost, BlendedCost, AmortizedCost, UsageQuantity | |
| group_by | No | Group results by dimension (e.g., [{"Type": "DIMENSION", "Key": "SERVICE"}]) | |
| filter | No | Cost Explorer filter expression |