Repository navigation
Commit 3e0620f
authored
fix(billing-cost-management-mcp-server): format cost-optimization get_recommendation timestamp like list_recommendations (#4859)
get_recommendation built last_refresh_timestamp with str(), so a live call
returned '2026-10-23 21:40:14+00:00' where list_recommendations returns
'2026-10-23T21:40:14' for the same recommendation, and a response without
lastRefreshTimestamp (GetRecommendation has no required output members)
returned the string 'None'. It now uses format_timestamp, as
list_recommendations does, and returns None when the field is absent.
Also remove the `if not recommendation` warning branch. botocore always
adds ResponseMetadata, so the response is never empty; a missing
recommendation raises ResourceNotFoundException (confirmed live), which
is already reported as a warning naming the ID. The branch only ran for a
mocked {} response, and its two tests are removed.1 parent 02cd0aa commit 3e0620f
2 files changed
Lines changed: 28 additions & 36 deletions
File tree
- src/billing-cost-management-mcp-server
- awslabs/billing_cost_management_mcp_server/tools
- tests/tools
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
221 | 221 | | |
222 | 222 | | |
223 | 223 | | |
224 | | - | |
225 | | - | |
226 | | - | |
227 | | - | |
228 | | - | |
229 | | - | |
230 | | - | |
231 | | - | |
232 | | - | |
233 | | - | |
234 | | - | |
235 | | - | |
236 | | - | |
237 | | - | |
238 | | - | |
239 | | - | |
240 | | - | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
241 | 227 | | |
242 | 228 | | |
243 | 229 | | |
| |||
255 | 241 | | |
256 | 242 | | |
257 | 243 | | |
258 | | - | |
| 244 | + | |
259 | 245 | | |
260 | 246 | | |
261 | 247 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
| 33 | + | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| |||
646 | 646 | | |
647 | 647 | | |
648 | 648 | | |
649 | | - | |
650 | | - | |
651 | | - | |
652 | | - | |
653 | | - | |
654 | | - | |
655 | | - | |
656 | | - | |
657 | | - | |
658 | | - | |
659 | | - | |
660 | | - | |
661 | | - | |
662 | | - | |
663 | | - | |
664 | | - | |
665 | | - | |
666 | 649 | | |
667 | 650 | | |
668 | 651 | | |
| |||
1002 | 985 | | |
1003 | 986 | | |
1004 | 987 | | |
| 988 | + | |
| 989 | + | |
| 990 | + | |
| 991 | + | |
| 992 | + | |
| 993 | + | |
| 994 | + | |
| 995 | + | |
| 996 | + | |
| 997 | + | |
| 998 | + | |
| 999 | + | |
| 1000 | + | |
| 1001 | + | |
| 1002 | + | |
| 1003 | + | |
| 1004 | + | |
| 1005 | + | |
| 1006 | + | |
| 1007 | + | |
| 1008 | + | |
| 1009 | + | |
| 1010 | + | |
1005 | 1011 | | |
1006 | 1012 | | |
1007 | 1013 | | |
| |||
0 commit comments