Repository navigation
fix(billing-cost-management-mcp-server): correct paging limit, metrics default, effort and filter texts - #4994
Open
finklen-amazon wants to merge 1 commit into
Open
finklen-amazon wants to merge 1 commit into
finklen-amazon wants to merge 1 commit into
Conversation
finklen-amazon
requested review from
a team,
Comusus,
Dinkie,
Rahul-1404,
anniewn,
bhatia-di,
callnmm,
chittev,
johnwangwyx,
junaidgirkar,
mattkelsey,
shsrams,
somsubhro,
wangyuhere and
yasmeenh11
as code owners
November 2, 2026 20:10
…s default, effort and filter texts - business-support and cost-anomaly-monitors: omitting max_items fetches pages only up to the configured BCM_MCP_PAGINATION_MAX_SECONDS limit, not "no limit". Their paging arg docs, and ri-performance's, point at that limit. - ri-performance: the max_pages line no longer hardcodes 300 seconds. - Server instructions: only cost-explorer returns UnblendedCost when metrics is omitted; sp-performance and ri-performance coverage take their own metrics. - Graviton prompt: the Compute Optimizer fallback reports migration_effort (VeryLow to High), not implementation_effort, on a different scale from Cost Optimization Hub's (VeryLow to VeryHigh); use the rank 1 option and never mix the two scales. - sp-explorer filters: a term that is not a whole number, a non-numeric upfront or commitment, or a start or end not starting with a millisecond timestamp is a ValidationException, not an empty list; upfront and commitment compare as numbers; rate tenancy also takes host. The empty-result hint scopes exact matching to text values.
finklen-amazon
force-pushed
the
fix/bcm-desc-accuracy
branch
from
November 2, 2026 20:18
054c73d to
a6c0cfc
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4994 +/- ##
==========================================
- Coverage 93.79% 93.79% -0.01%
==========================================
Files 1080 1080
Lines 94712 94713 +1
Branches 15442 15442
==========================================
Hits 88833 88833
Misses 3505 3505
- Partials 2374 2375 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes
Summary
Changes
Several served texts told the model something the server or the AWS APIs do not do. This PR corrects them. It changes text only; request and response handling are unchanged, apart from the wording of one empty-result hint.
Paging limit.
business-supportsaid that omittingmax_itemsfetches every page "(no limit)", andcost-anomaly-monitorsleft the limit out. Both page through the same time-bounded pager as every other tool, which stops atBCM_MCP_PAGINATION_MAX_SECONDS. Both now splice inPAGINATION_LIMIT_TEXT.ri-performancehardcoded "300-second" in itsmax_pagesline, so with the limit set to 2 the same description said both 2 and 300; it now says "the same time limit". Themax_items/max_pagesarg docs in these tools, and incost-anomaly, now point at the limit. The business-supporthas_morenote names the limit as a cause too.Metrics default (server instructions). "If
metricsis omitted, the tool returns UnblendedCost" holds only forcost-explorer.sp-performancecoverage sendsSpendCoveredBySavingsPlans, andri-performancecoverage sends no metrics, so the API returns hours only. Both coverage operations rejectUnblendedCostwith aValidationException. The sentence now says so.Graviton prompt. The Compute Optimizer fallback grouped results by
implementation_effort, which Compute Optimizer does not return. Each Compute Optimizer recommendation option carries its ownmigration_effort(VeryLow, Low, Medium, High) and savings. That scale differs from Cost Optimization Hub'simplementation_effort(VeryLow to VeryHigh): for the same instance and the same Graviton target, read-only calls returned Low or Medium from Compute Optimizer and VeryHigh from Cost Optimization Hub. The prompt now namesmigration_effort, says to use the rank 1 option, and says never to mix the two scales.sp-explorer filters. The text said any
describe_savings_plansfilter value that matches no plan returns an empty list. That holds only for well-formed values. The service rejects these with aValidationException:termthat is not a whole number of seconds ("1yr","31536000.0");upfrontorcommitmentthat is not a number ("$4.38");startorendthat does not begin with a millisecond timestamp (a date only, or no milliseconds).upfrontandcommitmentcompare as numbers ("4.380"matches 4.38). Ratetenancyalso takeshost; capitalized spellings such asSharedmatch nothing. The empty-result hint now limits "matched exactly" to text values.Tests:
test_time_bounded_tools_state_the_configured_limit(business-support, cost-anomaly-monitors, ri-performance; description and served arg docs, with the limit overridden).test_metrics_default_is_scoped_to_cost_explorer.mainand pass here. The rest are regression guards.Not changed:
cost-comparisonrejects filters nested 97 or more levels deep. A probe showed some 97-level shapes succeed in the service, but the exact failing shapes are not pinned down yet, so the limit is left as is. Many other tools'max_itemsarg docs also say "None fetches every page" without the limit (their tool descriptions do state it). That sweep is left for a follow-up.User experience
Before:
UnblendedCostto a coverage operation and get aValidationException.implementation_effortto group by, or mixed two different effort scales.After: the descriptions, arg docs, instructions and prompt match what the server and the APIs do. Every claim was checked against a live call (read-only), and each text claim was shown to fail on
mainand pass on this branch.Checklist
If your change doesn't seem to apply, please leave them unchecked.
Is this a breaking change? N
RFC issue number:
Checklist:
Acknowledgment
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of the project license.