get_price
Check pricing and availability for SMS verification services by country. Verify costs before purchasing virtual phone numbers for platforms like Telegram, WhatsApp, or Google.
Instructions
Check the price and availability for a specific service + country combination. Always check price before buying to confirm availability.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| service | Yes | Service code (e.g. "telegram", "whatsapp", "google") | |
| country | Yes | Country ISO code (e.g. "US", "GB", "RU") |
Implementation Reference
- src/tools.ts:399-450 (handler)The handler function `handleCheckPrice` that calls the `VirtualSMSClient.checkPrice` method.
export async function handleCheckPrice( client: VirtualSMSClient, args: z.infer<typeof CheckPriceInput> ) { let price; try { price = await client.checkPrice(args.service, args.country); } catch (err) { const msg = (err as Error).message ?? ''; // 404 or explicit unavailability → return clear user-facing message if (msg.includes('Not found') || msg.includes('404')) { return { content: [ { type: 'text' as const, text: JSON.stringify( { available: false, message: 'Service/country combination not available' }, null, 2 ), }, ], }; } throw err; } // Guard: if backend says not available, don't pass through a misleading result if (!price.available) { return { content: [ { type: 'text' as const, text: JSON.stringify( { available: false, message: 'Service/country combination not available' }, null, 2 ), }, ], }; } return { content: [ { type: 'text' as const, text: JSON.stringify(price, null, 2), }, ], }; } - src/tools.ts:104-131 (registration)The tool definition for `get_price` in the `TOOL_DEFINITIONS` array.
{ name: 'get_price', title: 'Check Service Price', description: 'Check the price and availability for a specific service + country combination. ' + 'Always check price before buying to confirm availability.', inputSchema: { type: 'object' as const, properties: { service: { type: 'string', description: 'Service code (e.g. "telegram", "whatsapp", "google")', }, country: { type: 'string', description: 'Country ISO code (e.g. "US", "GB", "RU")', }, }, required: ['service', 'country'], }, annotations: { title: 'Check Service Price', readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: true, }, }, - src/tools.ts:7-10 (schema)The input schema `CheckPriceInput` defining the arguments required by the `get_price` tool.
export const CheckPriceInput = z.object({ service: z.string().describe('Service code (e.g. "telegram", "whatsapp", "google")'), country: z.string().describe('Country ISO code (e.g. "US", "GB", "RU") or country name'), });