Skip to main content
Glama
cortezcristian

Kubecost MCP Server

update_budget

Modify an existing budget rule in Kubecost to adjust spending limits, notification settings, and resource allocations for cost management.

Instructions

Update an existing budget rule in Kubecost

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
actionsYes
budgetIdYes
intervalYes
intervalDayYes
kindYes
nameYes
spendLimitYes
valuesYes

Implementation Reference

  • src/index.ts:112-151 (registration)
    Registration of the 'update_budget' tool on the MCP server, including inline schema and handler function.
    this.tool(
      'update_budget',
      'Update an existing budget rule in Kubecost',
      {
        budgetId: z.string(),
        name: z.string(),
        values: z.object({
          cluster: z.array(z.string()).optional(),
          namespace: z.array(z.string()).optional(),
          label: z.record(z.array(z.string())).optional(),
        }),
        kind: z.enum(['soft', 'hard']),
        interval: z.enum(['weekly', 'monthly']),
        intervalDay: z.number(),
        spendLimit: z.number(),
        actions: z.array(z.object({
          percentage: z.number(),
          emails: z.array(z.string()).optional(),
          slackWebhooks: z.array(z.string()).optional(),
          msTeamsWebhooks: z.array(z.string()).optional(),
        })),
      },
      async ({ budgetId, ...budgetData }) => {
        try {
          const result = await this.kubecostClient.createOrUpdateBudget({
            ...budgetData,
            id: budgetId,
          });
          return {
            isError: false,
            content: [{ type: 'text', text: `Budget updated successfully: ${JSON.stringify(result, null, 2)}` }]
          };
        } catch (error) {
          return {
            isError: true,
            content: [{ type: 'text', text: error instanceof Error ? error.message : String(error) }]
          };
        }
      }
    );
  • Handler function for 'update_budget' tool that constructs the budget object with ID and calls KubecostClient.createOrUpdateBudget.
    async ({ budgetId, ...budgetData }) => {
      try {
        const result = await this.kubecostClient.createOrUpdateBudget({
          ...budgetData,
          id: budgetId,
        });
        return {
          isError: false,
          content: [{ type: 'text', text: `Budget updated successfully: ${JSON.stringify(result, null, 2)}` }]
        };
      } catch (error) {
        return {
          isError: true,
          content: [{ type: 'text', text: error instanceof Error ? error.message : String(error) }]
        };
      }
    }
  • Zod input schema for validating parameters of the 'update_budget' tool.
      budgetId: z.string(),
      name: z.string(),
      values: z.object({
        cluster: z.array(z.string()).optional(),
        namespace: z.array(z.string()).optional(),
        label: z.record(z.array(z.string())).optional(),
      }),
      kind: z.enum(['soft', 'hard']),
      interval: z.enum(['weekly', 'monthly']),
      intervalDay: z.number(),
      spendLimit: z.number(),
      actions: z.array(z.object({
        percentage: z.number(),
        emails: z.array(z.string()).optional(),
        slackWebhooks: z.array(z.string()).optional(),
        msTeamsWebhooks: z.array(z.string()).optional(),
      })),
    },
  • KubecostClient method that performs the HTTP POST to create or update a budget rule, called by the tool handler.
    async createOrUpdateBudget(budget: BudgetRule): Promise<BudgetResponse> {
      const response = await this.client.post('/model/budget', budget);
      return response.data;
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. While 'Update' implies a mutation operation, it doesn't describe what happens on success/failure, whether changes are reversible, permission requirements, or rate limits. For a complex update tool with 8 required parameters, this is inadequate.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that states the core purpose without unnecessary words. It's appropriately sized and front-loaded with the essential information, though it lacks detail.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a complex mutation tool with 8 required parameters, nested objects, no annotations, and no output schema, the description is severely incomplete. It doesn't explain what the tool returns, error conditions, or provide any parameter guidance. The description fails to compensate for the lack of structured documentation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 0%, meaning none of the 8 parameters have descriptions in the schema. The tool description provides absolutely no information about what any parameter means, their formats, or how they interact. This leaves all parameters completely undocumented.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Update') and resource ('an existing budget rule in Kubecost'), making the purpose unambiguous. However, it doesn't distinguish this tool from its sibling 'create_budget' beyond the 'existing' qualifier, which is why it doesn't reach the highest score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'create_budget' or 'delete_budget'. It mentions 'existing budget rule' which implies the budget must already exist, but doesn't specify prerequisites, error conditions, or when other tools might be more appropriate.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/cortezcristian/kubecost-mcp'

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