Skip to main content
Glama
cortezcristian

Kubecost MCP Server

create_budget

Create budget rules in Kubecost to monitor and control Kubernetes cluster spending by setting spending limits and configuring alerts for cost overruns.

Instructions

Create a new budget rule in Kubecost

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
actionsYes
intervalYes
intervalDayYes
kindYes
nameYes
spendLimitYes
valuesYes

Implementation Reference

  • Executes the create_budget tool by calling the Kubecost client's createOrUpdateBudget method with the input budgetData and formats the success or error response.
    async (budgetData) => {
      try {
        const result = await this.kubecostClient.createOrUpdateBudget(budgetData);
        return {
          isError: false,
          content: [{ type: 'text', text: `Budget created successfully: ${JSON.stringify(result, null, 2)}` }]
        };
      } catch (error) {
        return {
          isError: true,
          content: [{ type: 'text', text: error instanceof Error ? error.message : String(error) }]
        };
      }
    }
  • Zod schema for validating the input parameters of the create_budget tool, defining the structure for budget creation data.
    {
      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(),
      })),
    },
  • src/index.ts:75-110 (registration)
    Registers the create_budget tool with the MCP server using this.tool, including name, description, input schema, and handler function.
    this.tool(
      'create_budget',
      'Create a new budget rule in Kubecost',
      {
        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 (budgetData) => {
        try {
          const result = await this.kubecostClient.createOrUpdateBudget(budgetData);
          return {
            isError: false,
            content: [{ type: 'text', text: `Budget created successfully: ${JSON.stringify(result, null, 2)}` }]
          };
        } catch (error) {
          return {
            isError: true,
            content: [{ type: 'text', text: error instanceof Error ? error.message : String(error) }]
          };
        }
      }
    );
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure but only states the basic action. It doesn't mention permissions required, whether the operation is idempotent, what happens on failure, or any rate limits. For a mutation tool with 7 required parameters, this leaves significant gaps in understanding how the tool behaves.

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 gets straight to the point with zero wasted words. It's appropriately sized for a basic tool description, though it lacks the detail needed for a complex tool.

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

Completeness1/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 7 required parameters, nested objects, no annotations, and no output schema, the description is completely inadequate. It doesn't explain what a 'budget rule' is, what the parameters control, what happens after creation, or any error conditions. The agent would struggle to use this tool correctly.

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?

With 0% schema description coverage and 7 required parameters (including complex nested objects), the description provides no information about what any parameter means or how they should be used. The description doesn't compensate at all for the lack of schema documentation, leaving parameters completely unexplained.

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 ('Create') and resource ('a new budget rule in Kubecost'), which provides a specific verb+resource combination. However, it doesn't distinguish this tool from its sibling 'update_budget' in terms of when to use one versus the other, which prevents a perfect 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 'update_budget' or 'list_budgets'. It lacks any context about prerequisites, timing, or exclusions, leaving the agent to guess based on the tool name alone.

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