#2933·mcp

billing-cost-management-mcp-server: get_reservation_coverage fails with ValidationException when group_by is specified

Author: gurajani-awsCreated Apr 9, 2026Updated Sep 15, 2026
Labelsbugneeds-triagestale

Describe the bug

The ri_performance tool's get_reservation_coverage operation fails with a ValidationException when group_by is provided. The AWS GetReservationCoverage API requires that Granularity and GroupBy are mutually exclusive, but the MCP server sends both — it defaults to DAILY granularity and does not omit it when group_by is specified.

The tool's own description states:

IMPORTANT: GroupBy and Granularity are mutually exclusive for coverage. When group_by is provided, granularity is automatically omitted from the coverage request.

This behavior is not implemented.

Expected Behavior

Granularity is omitted from the API call. Results grouped by INSTANCE_TYPE are returned, including attributes.instanceType, attributes.databaseEngine, attributes.deploymentOption, attributes.region, and coverage hours.

Current Behavior

ValidationException: Granularity is not supported when specifying groupBy

Full error response:

json
{
  "Error": {
    "Message": "Granularity is not supported when specifying groupBy",
    "Code": "ValidationException"
  }
}

Reproduction Steps

Call ri_performance with:

json
{
  "operation": "get_reservation_coverage",
  "start_date": "2026-03-01",
  "end_date": "2026-04-01",
  "filter": "{\"Dimensions\": {\"Key\": \"SERVICE\", \"Values\": [\"Amazon Relational Database Service\"]}}",
  "group_by": "[{\"Type\": \"DIMENSION\", \"Key\": \"INSTANCE_TYPE\"}]"
}

Tested 4 times with different group_by combinations — same error every time:

  1. group_by: [{"Type": "DIMENSION", "Key": "INSTANCE_TYPE"}] — fails
  2. group_by: [{"Type": "DIMENSION", "Key": "INSTANCE_TYPE"}, {"Type": "DIMENSION", "Key": "REGION"}, {"Type": "DIMENSION", "Key": "DATABASE_ENGINE"}, {"Type": "DIMENSION", "Key": "DEPLOYMENT_OPTION"}] — fails
  3. Without group_by + with granularity: "MONTHLY" — succeeds (returns aggregate only)
  4. With granularity: "NONE" + group_by — fails (NONE is not a valid granularity value)

Possible Solution

No response

Additional Information/Context

No response

OS

macOS

Server

billing-cost-management-mcp-server

Server Version

No response

Region experiencing the issue

us-east-1

Other information

No response

Service quota

  • I have reviewed the service quotas for this construct