list_budgets
Retrieve all configured budget rules to monitor and control Kubernetes spending across your cloud infrastructure.
Instructions
List all budget rules in Kubecost
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:36-53 (registration)Registration of the 'list_budgets' MCP tool using McpServer.tool(), including inline description, input schema (empty object indicating no parameters), and complete handler function that calls the Kubecost client and returns the result as JSON text.
'list_budgets', 'List all budget rules in Kubecost', {}, async () => { try { const result = await this.kubecostClient.listBudgets(); return { isError: false, content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] }; } catch (error) { return { isError: true, content: [{ type: 'text', text: error instanceof Error ? error.message : String(error) }] }; } } ); - src/client/kubecost-client.ts:53-56 (helper)Core helper function in KubecostClient that performs the actual API call to list budgets by GET /model/budget endpoint.
async listBudgets(): Promise<BudgetListResponse> { const response = await this.client.get('/model/budget'); return response.data; } - src/types/kubecost.ts:42-44 (schema)TypeScript interface defining the expected response structure for the listBudgets API call, used for type safety in the handler.
export interface BudgetListResponse { budgets: BudgetResponse[]; }