Buy a phone number
buy_phone_numberPurchases one available Vobiz phone number and adds it to your account after verifying fees, balance, inventory, and purchase limits; requires explicit confirmation and an idempotency key.
Instructions
Buy one phone number from Vobiz inventory and add it to this account. The setup fee plus the first monthly fee are charged to the account balance immediately (a sub-account's parent is charged). Before buying, the server checks in order: provisioning enabled, the number is not already owned, it is in inventory (else not_found), setup + monthly fee within VOBIZ_MAX_NUMBER_COST, enough available balance (postpaid accounts skip this), and the daily purchase cap. Find candidates with search_available_numbers first; configure the bought number with update_phone_number and undo a purchase with release_phone_number. Requires confirm: true after showing the user the number and its fees, plus an idempotency_key; repeating the key replays the first result and never buys twice.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| confirm | Yes | Must be true, set only after the user explicitly approved: buying this number at the quoted fees. If your client supports MCP elicitation, the server asks the user to approve directly and this flag is not relied on; otherwise it is your attestation that the user approved. | |
| currency | No | ISO 4217 code (e.g. INR, USD) of the wallet to charge. Defaults to the number's listed currency, then the server's configured balance currency, then the account's primary wallet. | |
| phone_number | Yes | The number to buy, in E.164 form exactly as search_available_numbers listed it (e.g. +918065551234). | |
| idempotency_key | Yes | Unique key for this intended operation (e.g. a UUID). Repeating it replays the first result instead of acting again. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | No | True on success. On a failure the result is isError with ok: false plus `error` (kind), `message`, `retryable` and sometimes `http_status`. | |
| number | No | The number record Vobiz returned after purchase (e164, status, fees), or null if it sent none. | |
| purchased | No | True when the number was bought by this call. | |
| compliance | No | Set when the number needs Aadhaar verification in the Vobiz console before use; otherwise null. | |
| http_status | No | HTTP status Vobiz answered with. | |
| backend_message | No | Status message from Vobiz (e.g. 'created' or 'changed'), when it sent one. | |
| charged_estimate | No | What the purchase is expected to cost; the wallet transaction is authoritative. |