Skip to main content
Glama
cortezcristian

Kubecost MCP Server

get_assets

Retrieve asset cost and allocation data from Kubecost for specified time periods, with options to aggregate results and apply filters for detailed cost analysis.

Instructions

Get asset data from Kubecost

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
aggregateNo
filtersNo
windowYes

Implementation Reference

  • src/index.ts:199-221 (registration)
    MCP tool registration for "get_assets" including description, Zod input schema, and inline async handler that delegates to KubecostClient.getAssets and formats response as JSON text.
    this.tool(
      'get_assets',
      'Get asset data from Kubecost',
      {
        window: z.string(),
        aggregate: z.string().optional(),
        filters: z.record(z.string()).optional(),
      },
      async (params) => {
        try {
          const result = await this.kubecostClient.getAssets(params);
          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) }]
          };
        }
      }
    );
  • Core handler logic in KubecostClient.getAssets method: makes authenticated HTTP GET request to Kubecost /model/assets API endpoint with query params and returns parsed AssetResponse data.
    async getAssets(params: {
      window: string;
      aggregate?: string;
      filters?: Record<string, string>;
    }): Promise<AssetResponse> {
      const response = await this.client.get('/model/assets', { params });
      return response.data;
    }
  • TypeScript interface defining the structure of the AssetResponse returned by the getAssets API call, used for type safety in the tool implementation.
    export interface AssetResponse {
      data: {
        name: string;
        properties: {
          cluster: string;
          type: string;
          provider: string;
          providerId: string;
          account: string;
          project: string;
          service: string;
          category: string;
          labels: Record<string, string>;
        };
        window: {
          start: string;
          end: string;
        };
        totals: {
          cost: number;
          adjustment: number;
          totalCost: number;
        };
      }[];
    } 
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 only states the action ('Get asset data') without detailing whether this is a read-only operation, if it requires authentication, what the return format is, or any rate limits. For a tool with 3 parameters and no output schema, this is a significant gap in transparency.

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 extremely concise ('Get asset data from Kubecost'), consisting of a single, front-loaded sentence with no wasted words. It efficiently states the core purpose without unnecessary elaboration, 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 complexity (3 parameters, nested objects, no output schema) and lack of annotations, the description is incomplete. It doesn't explain what 'asset data' includes, how parameters are used, or what the tool returns. For a data retrieval tool with multiple inputs, more context is needed to guide effective use.

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 schema description coverage is 0%, meaning parameters are undocumented in the schema. The description adds no information about the parameters (aggregate, filters, window), their meanings, or how they affect the query. With 3 parameters and no output schema, the description fails to compensate for the lack of schema documentation.

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

Purpose3/5

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

The description states the tool's purpose ('Get asset data from Kubecost'), which is clear but vague. It specifies the verb ('Get') and resource ('asset data'), but doesn't distinguish it from potential siblings like 'get_cost_allocation' or explain what 'asset data' entails. The purpose is understandable but lacks specificity about scope or content.

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. With siblings like 'get_cost_allocation' and 'get_budget', it's unclear if this is for financial assets, infrastructure assets, or other types. There's no mention of prerequisites, context, or exclusions, leaving usage ambiguous.

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