Skip to main content
Glama
virtualsms-io

VirtualSMS MCP Server

list_active_orders

Retrieve active SMS verification orders to monitor pending requests or recover from session interruptions. View order details and associated phone numbers to manage verification processes.

Instructions

List your active orders. Essential for crash recovery — if your session was interrupted, use this to find pending orders and their phone numbers, then use check_sms to retrieve codes.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
statusNoOptional status filter: "pending", "sms_received", "cancelled", "completed"

Implementation Reference

  • Handler for listing active orders using the VirtualSMSClient.
    export async function handleActiveOrders(
      client: VirtualSMSClient,
      args: z.infer<typeof ActiveOrdersInput>
    ) {
      const orders = await client.listOrders(args.status);
      return {
        content: [
          {
            type: 'text' as const,
            text: JSON.stringify(
              {
                count: orders.length,
                orders: orders.map((o) => ({
                  order_id: o.order_id,
                  phone_number: o.phone_number,
                  status: o.status,
                  sms_code: o.sms_code,
                  sms_text: o.sms_text,
                  expires_at: o.expires_at,
                })),
                tip: orders.length > 0
                  ? 'Use check_sms with any order_id to get the latest status, or cancel_order to refund pending orders.'
                  : 'No orders found.',
              },
              null,
              2
            ),
          },
        ],
      };
    }
  • src/tools.ts:348-370 (registration)
    Registration of the list_active_orders tool definition.
      name: 'list_active_orders',
      title: 'List Active Orders',
      description:
        'List your active orders. Essential for crash recovery — if your session was interrupted, ' +
        'use this to find pending orders and their phone numbers, then use check_sms to retrieve codes.',
      inputSchema: {
        type: 'object' as const,
        properties: {
          status: {
            type: 'string',
            description: 'Optional status filter: "pending", "sms_received", "cancelled", "completed"',
          },
        },
        required: [],
      },
      annotations: {
        title: 'List Active Orders',
        readOnlyHint: true,
        destructiveHint: false,
        idempotentHint: true,
        openWorldHint: true,
      },
    },
  • Input schema for list_active_orders.
    export const ActiveOrdersInput = z.object({
      status: z.string().optional().describe('Optional status filter: "pending", "sms_received", "cancelled", "completed"'),
    });

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