| name | aws-cost-optimization |
| description | AWS cost optimization with billing analysis, RI/SP evaluation, storage optimization, idle resource identification, and interactive cost reports |
| tools | ["aws_pricing","billing_analysis"] |
AWS Cost Optimization
Analysis Process
- Data Collection: Use
query_price tool to get current pricing for relevant services
- Billing Analysis: If the customer provides a billing file (CSV or Excel), use
analyze_billing tool to:
- Parse the file and compute per-service cost distribution
- Detect month-over-month anomalies (services with >20% cost growth)
- Generate an interactive HTML report with Chart.js charts (pie chart for distribution, bar chart for monthly trends)
- The tool returns
total_cost, top_services, anomalies, and a report_url for the visual report
- Resource Assessment: Retrieve resource usage data via MCP-connected AWS CLI tools
- Optimization Recommendations:
- Reserved Instance / Savings Plan evaluation (refer to
references/ri-sp-guide.md)
- Storage tier optimization (S3 Intelligent-Tiering, EBS gp3 migration)
- Idle resource cleanup (unused EIPs, idle EBS volumes, stopped EC2 instances)
- Data transfer optimization (CloudFront, VPC Endpoints)
- Report Generation: Generate cost optimization report using
templates/cost-report.md template. When billing data is available, fill in the Billing Analysis section with anomalies, cost distribution, and link to the interactive HTML report
Key Checks
- EC2: Instance utilization < 30% — recommend downsizing or Spot
- RDS: Is Multi-AZ necessary? Is storage type optimal?
- S3: Lifecycle policies, storage class distribution
- Lambda: Memory over-provisioned? Execution time optimization
- NAT Gateway: Can data transfer costs be reduced via VPC Endpoints?
Billing Analysis Workflow
When the customer provides an AWS billing file:
- Ask the customer to upload the billing CSV or Excel file
- Call
analyze_billing with the uploaded file URL and format (csv or excel)
- Optional: set
anomaly_threshold to customize sensitivity (default 20%)
- Review the returned
anomalies list — services with cost growth above the threshold need immediate attention
- Use
top_services from the result to focus optimization efforts on the highest-cost services
- Cross-reference the cost distribution with
query_price to identify pricing optimization opportunities (e.g., RI/SP for top-cost EC2 instances)
- Share the
report_url (interactive HTML report) with the customer as a visual aid
- Incorporate findings into the final cost optimization report using the template
Billing File Requirements
The analyze_billing tool accepts:
- Formats: CSV or Excel (xlsx/xls)
- Expected columns: Service name, Date/Month, Cost/Amount (flexible column name matching)
- If the file format is invalid, the tool returns an error with format guidance — relay this to the customer
Referenced Tools
query_price: Query AWS real-time pricing for specific services and regions
analyze_billing: Parse AWS billing files (CSV/Excel), detect cost anomalies (configurable threshold), generate interactive HTML reports with Chart.js visualizations
execute_code: Data analysis and custom calculations
create_file: Generate report files and deliverables