Skip to main content
Glama
virtualsms-io

VirtualSMS MCP Server

List Active Orders

virtualsms_list_orders
Read-onlyIdempotent

List active SMS orders for crash recovery. Identify pending orders and phone numbers, then use check_sms to retrieve verification codes.

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

  • The handler function `handleActiveOrders` that executes the 'virtualsms_list_orders' tool logic. It calls `client.listOrders(args.status)`, maps the results to a simplified format (order_id, phone_number, status, sms_code, sms_text, expires_at), and returns a JSON stringified response with a count and tip.
    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
            ),
          },
        ],
      };
    }
  • The tool definition/registration schema for 'virtualsms_list_orders' within the TOOL_DEFINITIONS array. Defines the name, title, description, inputSchema (optional status filter), and annotations including readOnlyHint and idempotentHint.
    {
      name: 'virtualsms_list_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,
      },
    },
  • The `ActiveOrdersInput` Zod schema used to validate the input parameters for the 'virtualsms_list_orders' tool. Defines an optional 'status' field for filtering by status (pending, sms_received, cancelled, completed).
    export const ActiveOrdersInput = z.object({
      status: z.string().optional().describe('Optional status filter: "pending", "sms_received", "cancelled", "completed"'),
    });
  • src/index.ts:143-146 (registration)
    The registration in the main MCP server (stdio transport). The 'virtualsms_list_orders' case in the CallToolRequestSchema switch statement that parses args with ActiveOrdersInput and calls handleActiveOrders.
    case 'virtualsms_list_orders': {
      const parsed = ActiveOrdersInput.parse(args);
      return await handleActiveOrders(client, parsed);
    }
  • The registration in the HTTP server variant. The 'virtualsms_list_orders' case in the CallToolRequestSchema switch statement that parses args with ActiveOrdersInput and calls handleActiveOrders.
    case 'virtualsms_list_orders': {
      const parsed = ActiveOrdersInput.parse(args);
      return await handleActiveOrders(client, parsed);
    }
Behavior4/5

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

Annotations declare readOnlyHint, idempotentHint, etc. Description adds behavioral context about crash recovery and that the tool returns phone numbers. No contradiction with annotations.

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?

Two sentences: first states purpose, second provides a critical use case. No fluff, front-loaded, efficient.

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?

No output schema, but description hints at return fields (orders with phone numbers). Lacks details on pagination or ordering, but for a list tool with one optional parameter, it is fairly complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Input schema has 100% coverage with a clear description for the single optional parameter 'status'. Description does not add further parameter semantics beyond the schema.

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?

Description states 'List your active orders' with a specific verb and resource. It distinguishes from sibling tools like virtualsms_get_order and virtualsms_order_history. Minor inconsistency: input schema allows filtering by various statuses, not just 'active', but overall clear.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly describes a key use case: crash recovery. Tells agent to use this tool to find pending orders and phone numbers, then follow up with check_sms. Does not specify when not to use, but provides clear context.

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

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