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
| Name | Required | Description | Default |
|---|---|---|---|
| order_id | Yes | Order ID returned from buy_number |
Implementation Reference
- src/tools.ts:489-509 (handler)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, }, }, - src/tools.ts:17-19 (schema)Input schema definition for "get_sms_code".
export const CheckSmsInput = z.object({ order_id: z.string().describe('Order ID returned from buy_number'), });