Skip to main content
Glama

get_account_balance

Check your Kling AI account balance and available credits to monitor your video generation resource usage and account status.

Instructions

Check your Kling AI account balance and total available credits. Provides a comprehensive overview of your account status including total balance and breakdown by resource packages.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Core handler function that makes API call to retrieve Kling AI account balance
    async getAccountBalance(): Promise<AccountBalance> {
      const path = '/v1/account/balance';
    
      try {
        const response = await this.axiosInstance.get(path);
        return response.data.data;
      } catch (error) {
        if (axios.isAxiosError(error)) {
          throw new Error(`Kling API error: ${error.response?.data?.message || error.message}`);
        }
        throw error;
      }
    }
  • MCP server handler case that invokes klingClient.getAccountBalance and formats response for the tool call
    case 'get_account_balance': {
      const balance = await klingClient.getAccountBalance();
      
      let balanceText = `Kling AI Account Balance:\n\nTotal Balance: ${balance.total_balance} credits`;
      
      if (balance.resource_packages && balance.resource_packages.length > 0) {
        balanceText += '\n\nResource Packages Breakdown:';
        balance.resource_packages.forEach((pkg, index) => {
          balanceText += `\n\nPackage ${index + 1}:`;
          balanceText += `\n- Name: ${pkg.name}`;
          balanceText += `\n- Amount: ${pkg.amount} credits`;
          balanceText += `\n- Expires: ${new Date(pkg.expire_at).toLocaleString()}`;
        });
      }
      
      return {
        content: [
          {
            type: 'text',
            text: balanceText,
          },
        ],
      };
    }
  • src/index.ts:422-430 (registration)
    Tool registration in TOOLS array with name, description, and empty input schema
    {
      name: 'get_account_balance',
      description: 'Check your Kling AI account balance and total available credits. Provides a comprehensive overview of your account status including total balance and breakdown by resource packages.',
      inputSchema: {
        type: 'object',
        properties: {},
        required: [],
      },
    },
  • TypeScript interface defining the output structure of account balance response (schema for handler result)
    export interface AccountBalance {
      total_balance: number;
      resource_packages: ResourcePackage[];
    }
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. It describes what information is returned but doesn't mention authentication requirements, rate limits, error conditions, or whether this is a read-only operation. The description is informative but lacks critical operational context.

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

Conciseness4/5

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

The description is appropriately concise with two sentences that efficiently convey the tool's purpose and scope. It's front-loaded with the main function and follows with additional detail about what's included in the overview.

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

Completeness3/5

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

For a zero-parameter tool with no output schema, the description provides adequate information about what the tool does but lacks details about the return format, error handling, or authentication requirements. Given the complexity is low (no parameters), the description is reasonably complete but could benefit from more operational context.

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

Parameters4/5

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

The tool has 0 parameters with 100% schema description coverage, so the baseline is 4. The description appropriately doesn't discuss parameters since none exist, focusing instead on the tool's purpose and output.

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

Purpose5/5

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

The description clearly states the tool's purpose with specific verbs ('check', 'provides') and resources ('account balance', 'total available credits', 'account status', 'breakdown by resource packages'). It distinguishes itself from siblings like 'get_resource_packages' by focusing on overall account status rather than just package details.

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

Usage Guidelines3/5

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

The description implies usage context (checking account status) but doesn't explicitly state when to use this tool versus alternatives like 'get_resource_packages' or other sibling tools. No guidance on prerequisites or exclusions is provided.

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/199-mcp/mcp-kling'

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