Skip to main content
Glama
virtualsms-io

VirtualSMS MCP Server

get_sms_code

Retrieve SMS verification codes for online services by checking if a code has been received for a specific order ID. Use this tool to poll for OTP codes after purchasing a virtual phone number.

Instructions

Check if an SMS verification code has been received for an order. Poll this every 5-10 seconds after buying a number. For automatic polling, use wait_for_code instead.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
order_idYesOrder ID returned from buy_number

Implementation Reference

  • The tool "get_sms_code" (registered as "Check SMS Code") is implemented by the `handleCheckSms` function.
    export async function handleCheckSms(
      client: VirtualSMSClient,
      args: z.infer<typeof CheckSmsInput>
    ) {
      const order = await client.getOrder(args.order_id);
      const result: Record<string, unknown> = {
        status: order.status,
        phone_number: order.phone_number,
      };
      if (order.sms_code) result.sms_code = order.sms_code;
      if (order.sms_text) result.sms_text = order.sms_text;
    
      return {
        content: [
          {
            type: 'text' as const,
            text: JSON.stringify(result, null, 2),
          },
        ],
      };
    }
  • src/tools.ts:186-209 (registration)
    Registration of the tool "get_sms_code" in `TOOL_DEFINITIONS`.
      name: 'get_sms_code',
      title: 'Check SMS Code',
      description:
        'Check if an SMS verification code has been received for an order. ' +
        'Poll this every 5-10 seconds after buying a number. ' +
        'For automatic polling, use wait_for_code instead.',
      inputSchema: {
        type: 'object' as const,
        properties: {
          order_id: {
            type: 'string',
            description: 'Order ID returned from buy_number',
          },
        },
        required: ['order_id'],
      },
      annotations: {
        title: 'Check SMS Code',
        readOnlyHint: true,
        destructiveHint: false,
        idempotentHint: true,
        openWorldHint: true,
      },
    },
  • Input schema definition for "get_sms_code".
    export const CheckSmsInput = z.object({
      order_id: z.string().describe('Order ID returned from buy_number'),
    });

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