Skip to main content
Glama
cortezcristian

Kubecost MCP Server

get_budget

Retrieve detailed information about a specific budget rule in Kubecost to monitor and manage cloud spending effectively.

Instructions

Get detailed information about a specific budget rule

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
budgetIdYes

Implementation Reference

  • src/index.ts:55-72 (registration)
    Registration of the 'get_budget' MCP tool, including description, input schema requiring 'budgetId' as string, and inline handler function that executes kubecostClient.getBudget(budgetId) and returns the JSON-formatted result or error.
    this.tool(
      'get_budget',
      'Get detailed information about a specific budget rule',
      { budgetId: z.string() },
      async ({ budgetId }) => {
        try {
          const result = await this.kubecostClient.getBudget(budgetId);
          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) }]
          };
        }
      }
  • The core handler logic for the 'get_budget' tool: extracts budgetId from arguments, calls the Kubecost client to fetch the budget, stringifies the result as JSON text content for MCP response.
    async ({ budgetId }) => {
      try {
        const result = await this.kubecostClient.getBudget(budgetId);
        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) }]
        };
      }
  • Input schema definition for the 'get_budget' tool using Zod: requires a 'budgetId' string parameter.
    { budgetId: z.string() },
  • Helper method in KubecostClient that implements the actual API call to retrieve budget details via GET /model/budget/{budgetId}, returning BudgetResponse.
    async getBudget(budgetId: string): Promise<BudgetResponse> {
      const response = await this.client.get(`/model/budget/${budgetId}`);
      return response.data;
    }
  • Detailed JSON schema definition for 'get_budget' tool input (appears unused in current registration).
    get_budget: {
      description: 'Get detailed information about a specific budget rule',
      inputSchema: {
        type: 'object',
        properties: {
          budgetId: {
            type: 'string',
            description: 'The ID of the budget rule to retrieve',
          },
        },
        required: ['budgetId'],
      },
    },
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool retrieves 'detailed information,' implying a read-only operation, but doesn't specify aspects like authentication requirements, rate limits, error handling, or what 'detailed information' includes (e.g., fields, format). This is a significant gap for a tool with no annotation coverage.

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 directly states the tool's purpose without unnecessary words. It's appropriately sized and front-loaded, making it easy to parse quickly.

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?

Given the tool's complexity (a read operation with 1 parameter), lack of annotations, and no output schema, the description is incomplete. It doesn't cover behavioral traits, parameter details, or return values, leaving the agent with insufficient context to use the tool effectively beyond its basic purpose.

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

Parameters2/5

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

The input schema has 1 parameter with 0% description coverage, and the tool description doesn't add any parameter-specific information. It mentions 'a specific budget rule' but doesn't explain what 'budgetId' represents (e.g., format, source, constraints), leaving the parameter's meaning unclear beyond the schema's basic type.

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 verb ('Get') and resource ('detailed information about a specific budget rule'), making the purpose understandable. However, it doesn't explicitly differentiate from sibling tools like 'list_budgets' (which likely returns multiple budgets) or 'get_assets' (which targets different resources), leaving some ambiguity about scope.

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. It doesn't mention prerequisites (e.g., needing a budget ID), exclusions (e.g., not for listing budgets), or comparisons to siblings like 'list_budgets' or 'get_assets', leaving the agent to infer usage from context 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