Skip to main content
Glama

check_balance

Check your organization's current credit balance on Rhumb to monitor API usage and costs for AI agent development.

Instructions

Check the current credit balance for your organization on Rhumb

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main handler function for the check_balance MCP tool. It calls the Rhumb API client to fetch the current balance and formats a response message.
    export async function handleCheckBalance(
      _input: CheckBalanceInput,
      client: RhumbApiClient
    ): Promise<CheckBalanceOutput> {
      try {
        const balance = await client.getBalance();
        return {
          balance_usd: balance.balance_usd,
          balance_usd_cents: balance.balance_usd_cents,
          auto_reload_enabled: balance.auto_reload_enabled,
          message: balance.balance_usd_cents < 100
            ? `⚠️ Low balance: $${balance.balance_usd}. Top up at https://rhumb.dev/pricing`
            : `Balance: $${balance.balance_usd}`,
        };
      } catch (err) {
        return {
          balance_usd: 0,
          balance_usd_cents: 0,
          auto_reload_enabled: false,
          message: `Failed to check balance: ${err instanceof Error ? err.message : String(err)}`,
        };
      }
    }
  • Schema and type definitions for the input and output of the check_balance tool.
    export const CheckBalanceInputSchema = {
      type: "object" as const,
      properties: {},
      required: [] as string[],
    };
    
    export type CheckBalanceInput = Record<string, never>;
    
    export type CheckBalanceOutput = {
      balance_usd: number;
      balance_usd_cents: number;
      auto_reload_enabled: boolean;
      message: string;
    };

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/supertrained/rhumb'

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