Skip to main content
Glama
virtualsms-io

VirtualSMS MCP Server

get_price

Check pricing and availability for SMS verification services by country. Verify costs before purchasing virtual phone numbers for platforms like Telegram, WhatsApp, or Google.

Instructions

Check the price and availability for a specific service + country combination. Always check price before buying to confirm availability.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
serviceYesService code (e.g. "telegram", "whatsapp", "google")
countryYesCountry ISO code (e.g. "US", "GB", "RU")

Implementation Reference

  • The handler function `handleCheckPrice` that calls the `VirtualSMSClient.checkPrice` method.
    export async function handleCheckPrice(
      client: VirtualSMSClient,
      args: z.infer<typeof CheckPriceInput>
    ) {
      let price;
      try {
        price = await client.checkPrice(args.service, args.country);
      } catch (err) {
        const msg = (err as Error).message ?? '';
        // 404 or explicit unavailability → return clear user-facing message
        if (msg.includes('Not found') || msg.includes('404')) {
          return {
            content: [
              {
                type: 'text' as const,
                text: JSON.stringify(
                  { available: false, message: 'Service/country combination not available' },
                  null,
                  2
                ),
              },
            ],
          };
        }
        throw err;
      }
    
      // Guard: if backend says not available, don't pass through a misleading result
      if (!price.available) {
        return {
          content: [
            {
              type: 'text' as const,
              text: JSON.stringify(
                { available: false, message: 'Service/country combination not available' },
                null,
                2
              ),
            },
          ],
        };
      }
    
      return {
        content: [
          {
            type: 'text' as const,
            text: JSON.stringify(price, null, 2),
          },
        ],
      };
    }
  • src/tools.ts:104-131 (registration)
    The tool definition for `get_price` in the `TOOL_DEFINITIONS` array.
    {
      name: 'get_price',
      title: 'Check Service Price',
      description:
        'Check the price and availability for a specific service + country combination. ' +
        'Always check price before buying to confirm availability.',
      inputSchema: {
        type: 'object' as const,
        properties: {
          service: {
            type: 'string',
            description: 'Service code (e.g. "telegram", "whatsapp", "google")',
          },
          country: {
            type: 'string',
            description: 'Country ISO code (e.g. "US", "GB", "RU")',
          },
        },
        required: ['service', 'country'],
      },
      annotations: {
        title: 'Check Service Price',
        readOnlyHint: true,
        destructiveHint: false,
        idempotentHint: true,
        openWorldHint: true,
      },
    },
  • The input schema `CheckPriceInput` defining the arguments required by the `get_price` tool.
    export const CheckPriceInput = z.object({
      service: z.string().describe('Service code (e.g. "telegram", "whatsapp", "google")'),
      country: z.string().describe('Country ISO code (e.g. "US", "GB", "RU") or country name'),
    });

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