get_cost_and_usage
Query AWS cost and usage for a date range to analyze spend, group by service/region/tag, and filter to identify cost drivers.
Instructions
Query AWS cost and usage for account 135709585800 over a time period. Supports grouping (e.g. by SERVICE, USAGE_TYPE, REGION, LINKED_ACCOUNT, or a cost allocation TAG) and Cost Explorer filter expressions. Start date is inclusive, end date is exclusive. This is the primary tool for spend analysis: monthly trends, per-service breakdowns, daily spikes, etc.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| end | Yes | End date (exclusive), YYYY-MM-DD | |
| start | Yes | Start date (inclusive), YYYY-MM-DD | |
| filter | No | Optional Cost Explorer filter Expression as JSON, e.g. {"Dimensions":{"Key":"SERVICE","Values":["Amazon Elastic Compute Cloud - Compute"]}}. Supports And/Or/Not, Dimensions, Tags, CostCategories. | |
| metrics | No | Cost metrics to return. UsageQuantity is only meaningful when grouped/filtered to one usage type. | |
| group_by | No | Group results by up to 2 dimensions/tags. | |
| granularity | No | Time granularity. Prefer MONTHLY for trends, DAILY for spike analysis. | MONTHLY |