Skip to main content
Glama
virtualsms-io

VirtualSMS MCP Server

get_balance

Check your VirtualSMS account balance in USD to monitor SMS verification service credits. Requires VIRTUALSMS_API_KEY to be set.

Instructions

Check your VirtualSMS account balance in USD. Requires VIRTUALSMS_API_KEY to be set.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
currencyNoDisplay balance in specific currency (default: USD)

Implementation Reference

  • The handler function 'handleGetBalance' which executes the tool logic by calling the client's getBalance method.
    export async function handleGetBalance(client: VirtualSMSClient) {
      const balance = await client.getBalance();
      return {
        content: [
          {
            type: 'text' as const,
            text: JSON.stringify(balance, null, 2),
          },
        ],
  • src/tools.ts:133-148 (registration)
    Definition and registration of the 'get_balance' tool.
    name: 'get_balance',
    title: 'Get Account Balance',
    description:
      'Check your VirtualSMS account balance in USD. ' +
      'Requires VIRTUALSMS_API_KEY to be set.',
    inputSchema: {
      type: 'object' as const,
      properties: {
        currency: {
          type: 'string',
          description: 'Display balance in specific currency (default: USD)',
        },
      },
      required: [],
    },
    annotations: {
  • The underlying API client method that performs the actual network request to fetch the account balance.
    async getBalance(): Promise<Balance> {
      this.requireApiKey();
      const res = await this.http.get('/api/v1/customer/balance');
      const raw = res.data as Record<string, unknown>;
      return {
        balance_usd: Number(raw.balance_usd ?? raw.balance ?? 0),
      };
    }

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

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