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
| Name | Required | Description | Default |
|---|---|---|---|
| status | No | Optional status filter: "pending", "sms_received", "cancelled", "completed" |
Implementation Reference
- src/tools.ts:906-936 (handler)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, }, }, - src/tools.ts:49-51 (schema)Input schema for list_active_orders.
export const ActiveOrdersInput = z.object({ status: z.string().optional().describe('Optional status filter: "pending", "sms_received", "cancelled", "completed"'), });