Skip to main content
Glama

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
NameRequiredDescriptionDefault
account_idYesThe AWS Account ID (required for Budgets).

Implementation Reference

  • 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) }] }; }
  • 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"] } },
  • Initialization of the AWS BudgetsClient used by the tool handler.
    const budgetsClient = new BudgetsClient({});
  • Import of AWS SDK Budgets client and DescribeBudgetsCommand used in the tool.
    import { BudgetsClient, DescribeBudgetsCommand } from "@aws-sdk/client-budgets";

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Bhavesh8890/MCP-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server