Repository navigation
feat(billing-cost-management-mcp-server): add dimension_key and document ProductAttributes filters in cost-explorer - #4990
Merged
finklen-amazon merged 3 commits intoNov 3, 2026
Conversation
…ent ProductAttributes filters in cost-explorer getDimensionValues had no way to send DimensionKey, so the values of a PRODUCT_ATTRIBUTE key could not be listed, and the description did not name the ProductAttributes filter leaf at all. - cost-explorer takes dimension_key and sends it as DimensionKey. - The description documents the ProductAttributes leaf (Amazon Bedrock keys, case-sensitive, data from 2026-09-01, MatchOptions), its silent results (a wrong key or value returns $0; ABSENT or [""] matches all Bedrock costs for a wrong key; Not and a PRODUCT_ATTRIBUTE group_by cover only supported services), the SERVICE filter getDimensionValues requires with it, and that the forecasts reject it.
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 17:47
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4990 +/- ##
==========================================
- Coverage 93.79% 93.79% -0.01%
==========================================
Files 1080 1080
Lines 94712 94714 +2
Branches 15442 15443 +1
==========================================
+ Hits 88833 88834 +1
Misses 3505 3505
- Partials 2374 2375 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…he product attribute data start
finklen-amazon
enabled auto-merge
November 2, 2026 18:28
somsubhro
approved these changes
Nov 2, 2026
4 of 6 tasks
junaidgirkar
approved these changes
Nov 3, 2026
finklen-amazon
added a commit
that referenced
this pull request
Nov 3, 2026
…DimensionValues #4990 added the dimension_key argument, which getDimensionValues sends as DimensionKey. List it in OPERATION_ARGUMENTS for getDimensionValues and give it a reason, so it reaches that operation and is rejected on the operations that would drop it, with pointers to listing values, a PRODUCT_ATTRIBUTE group_by and a ProductAttributes filter leaf. The dimension reason now says that tag, cost category and PRODUCT_ATTRIBUTE keys take their own leaf type.
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.
Summary
Changes
cost-explorerhad no way to sendDimensionKeyto GetDimensionValues, so the values of aPRODUCT_ATTRIBUTEkey could not be listed. Its description also did not name theProductAttributesfilter leaf.cost-explorertakesdimension_keyand sends it asDimensionKey(getDimensionValues,dimension=PRODUCT_ATTRIBUTE). If it is omitted or empty, the response lists the keys.ProductAttributesleaf and its MatchOptions (EQUALS,ABSENT,CASE_SENSITIVE)provider,model,inferenceType,featuresearch_stringmatches partially and case-insensitivelyPRODUCT_ATTRIBUTEdimension-reference entryABSENTor[""]with a wrong key matches every Bedrock cost.Notand aPRODUCT_ATTRIBUTEgroup_by cover only Bedrock costs, so their totals do not reach the account total.key$value.dimension_keyreturns only"".And, one such leaf is enough; underOr, every branch needs one; a leaf underNotnever counts.And.User experience
Before: an agent could not list product attribute values. It had nothing telling it that a
ProductAttributesfilter exists, and nothing to warn it that a wrong key returns $0, or thatNotandABSENTcover only Bedrock costs.After:
{"operation": "getDimensionValues", "dimension": "PRODUCT_ATTRIBUTE", "dimension_key": "model"}lists the model names, which can then be used in aProductAttributesfilter. The description tells the agent about each of the results above.Testing
dimension_keyforwarding, and thatDimensionKeyis omitted when the key is empty, in both the tool and the operation, plus a description contract test for the new text. The existing contract tests now treatPRODUCT_ATTRIBUTEas a key accepted in fewer places.main: 13/18. The 5 that fail are thedimension_keyclaims and the description text. The 13 that pass are regression guards for existing API behavior, such asProductAttributesfilters already passing through thefilterargument.Checklist
Is this a breaking change? (Y/N) 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.