get_budget_details
Retrieve AWS Budgets with status, limits, and current spend to monitor and manage cloud costs effectively.
Instructions
Lists all AWS Budgets along with their status, limits, and current spend.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| account_id | Yes | The AWS Account ID (required for Budgets). |
Implementation Reference
- src/index.ts:1062-1077 (handler)Handler function that fetches AWS Budget details using AWS SDK's BudgetsClient and DescribeBudgetsCommand, processes the response to include budget name, limits, spends, type, and last updated time.if (name === "get_budget_details") { const accountId = (args as any).account_id; const command = new DescribeBudgetsCommand({ AccountId: accountId, MaxResults: 100 }); const response = await budgetsClient.send(command); const budgets = response.Budgets?.map(b => ({ BudgetName: b.BudgetName, Limit: b.BudgetLimit?.Amount + " " + b.BudgetLimit?.Unit, CurrentSpend: b.CalculatedSpend?.ActualSpend?.Amount + " " + b.CalculatedSpend?.ActualSpend?.Unit, ForecastedSpend: b.CalculatedSpend?.ForecastedSpend?.Amount + " " + b.CalculatedSpend?.ForecastedSpend?.Unit, BudgetType: b.BudgetType, LastUpdated: b.LastUpdatedTime })) || []; return { content: [{ type: "text", text: JSON.stringify(budgets, null, 2) }] }; }
- src/index.ts:235-244 (schema)Input schema definition for the get_budget_details tool, specifying the required 'account_id' parameter.name: "get_budget_details", description: "Lists all AWS Budgets along with their status, limits, and current spend.", inputSchema: { type: "object", properties: { account_id: { type: "string", description: "The AWS Account ID (required for Budgets)." } }, required: ["account_id"] } },
- src/index.ts:235-244 (registration)Tool registration in the ListTools response, defining name, description, and schema.name: "get_budget_details", description: "Lists all AWS Budgets along with their status, limits, and current spend.", inputSchema: { type: "object", properties: { account_id: { type: "string", description: "The AWS Account ID (required for Budgets)." } }, required: ["account_id"] } },
- src/index.ts:66-66 (helper)Initialization of the AWS BudgetsClient used by the tool handler.const budgetsClient = new BudgetsClient({});
- src/index.ts:32-32 (helper)Import of AWS SDK Budgets client and DescribeBudgetsCommand used in the tool.import { BudgetsClient, DescribeBudgetsCommand } from "@aws-sdk/client-budgets";