Skip to main content
Glama

get_balance

Read-onlyIdempotent

Check your current BubblyPhone credit balance in USD to monitor available funds for phone calls, AI voice agents, and telephony services.

Instructions

Get your current BubblyPhone credit balance in USD.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The actual handler function that executes the get_balance tool logic - calls the API endpoint /billing/balance via the client
    async () => callTool(() => client.get("/billing/balance"))
  • Registration of the get_balance tool with MCP server, including tool name, description, schema, annotations, and handler binding
    server.registerTool(
      "get_balance",
      {
        description: "Get your current BubblyPhone credit balance in USD.",
        inputSchema: {},
        annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
      },
      async () => callTool(() => client.get("/billing/balance"))
    );
  • Input schema for get_balance - empty object indicating no input parameters required
    inputSchema: {},
  • Helper function callTool that wraps API calls with standardized error handling and result formatting
    async function callTool<T>(fn: () => Promise<T>) {
      try {
        return toolResult(await fn());
      } catch (err) {
        const apiErr = err as ApiError;
        return toolError(`API error (${apiErr.status}): ${apiErr.message}`);
      }
    }
  • BubblyPhoneClient.get method - the underlying HTTP GET implementation used by the get_balance handler to fetch from /billing/balance
    async get<T = unknown>(path: string, params?: Record<string, string>): Promise<T> {
      const url = new URL(`${this.baseUrl}${path}`);
      if (params) {
        for (const [key, value] of Object.entries(params)) {
          if (value !== undefined && value !== "") {
            url.searchParams.set(key, value);
          }
        }
      }
      return this.request<T>(url.toString(), { method: "GET" });
    }
Behavior3/5

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

Annotations already indicate the operation is read-only, idempotent, and safe. The description adds valuable domain-specific context by specifying 'USD' as the currency unit and 'current' implying real-time balance, but omits details about return format, precision (cents vs dollars), or caching behavior.

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?

Single sentence with no extraneous words. Information is front-loaded with specific resource identification (BubblyPhone credit balance) and unit (USD) immediately clear.

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

Completeness4/5

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

For a simple, zero-parameter read operation with comprehensive safety annotations, the description is sufficient. It identifies the domain (BubblyPhone), resource type (credit balance), and unit (USD). Without an output schema, additional detail on return type would be helpful but not strictly necessary for correct invocation.

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?

Input schema contains zero parameters. According to scoring guidelines, zero-parameter tools receive a baseline score of 4. The description appropriately does not fabricate parameter requirements.

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?

Clearly states the tool retrieves the current credit balance for BubblyPhone and specifies the currency (USD), which distinguishes it from siblings like get_account or get_usage. However, uses generic verb 'Get' rather than 'Retrieve' and lacks explicit negative constraints (e.g., 'does not return transaction history').

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?

Provides no guidance on when to use this tool versus alternatives like list_transactions (for history) or get_usage (for consumption metrics). Does not mention prerequisites or typical use cases (e.g., checking funds before make_call).

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/JobXDubai/mcp-server'

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