Get Order Details
virtualsms_get_orderRetrieve full order details including status, phone number, service, country, timestamps, and received SMS code or text using the order ID. Use this to get the latest state of a virtual SMS verification order.
Instructions
Get the full details of a specific order, including status, phone number, service, country, timestamps, and any received SMS code/text. Use this when you have an order_id and need the latest state beyond what check_sms returns.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| order_id | Yes | Order ID to retrieve full details for |
Implementation Reference
- src/tools.ts:1240-1276 (handler)The handleGetOrder function that executes the 'virtualsms_get_order' tool logic. It calls client.getOrder(), extracts SMS messages and code, and returns a formatted JSON response.
export async function handleGetOrder( client: VirtualSMSClient, args: z.infer<typeof GetOrderInput> ) { const order = await client.getOrder(args.order_id); const messages = (order.messages && order.messages.length > 0) ? order.messages : (order.sms_text || order.sms_code) ? [{ content: order.sms_text || order.sms_code || '', sender: undefined, received_at: undefined }] : []; const firstContent = messages[0]?.content; const code = order.sms_code || (firstContent ? extractCode(firstContent) : undefined); const out: Record<string, unknown> = { order_id: order.order_id, phone_number: order.phone_number, service: order.service, country: order.country, price: order.price, status: order.status, created_at: order.created_at, expires_at: order.expires_at, }; if (messages.length > 0) out.messages = messages; if (code) { out.code = code; out.sms_code = code; } if (firstContent) out.sms_text = firstContent; return { content: [ { type: 'text' as const, text: JSON.stringify(out, null, 2), }, ], }; } - src/tools.ts:52-54 (schema)GetOrderInput Zod schema defining the input for virtualsms_get_order: requires an order_id string.
export const GetOrderInput = z.object({ order_id: z.string().describe('Order ID to retrieve full details for'), }); - src/tools.ts:402-426 (registration)Tool definition entry in TOOL_DEFINITIONS array registering virtualsms_get_order with name, title, description, inputSchema (order_id required), and annotations.
{ name: 'virtualsms_get_order', title: 'Get Order Details', description: 'Get the full details of a specific order, including status, phone number, service, country, ' + 'timestamps, and any received SMS code/text. Use this when you have an order_id and need the ' + 'latest state beyond what check_sms returns.', inputSchema: { type: 'object' as const, properties: { order_id: { type: 'string', description: 'Order ID to retrieve full details for', }, }, required: ['order_id'], }, annotations: { title: 'Get Order Details', readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: true, }, }, - src/http-server.ts:135-138 (handler)HTTP server route handler: parses args with GetOrderInput and calls handleGetOrder.
case 'virtualsms_get_order': { const parsed = GetOrderInput.parse(args); return await handleGetOrder(client, parsed); } - src/index.ts:148-151 (handler)Stdio server route handler: parses args with GetOrderInput and calls handleGetOrder.
case 'virtualsms_get_order': { const parsed = GetOrderInput.parse(args); return await handleGetOrder(client, parsed); }