Rent a phone number
buy_numberRent a phone number on a plan from get_pricing. Charges the plan price from the balance and renews automatically each period. Pass idempotency_key so a retry never rents twice. status "pending" means the number is still being set up and "number" is a placeholder with X digits; list_my_numbers shows the real number once it is "active".
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"plan_id": "<plan_id>"
},
"name": "buy_number"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| plan_id | Yes | planId from get_pricing | |
| webhook | No | Optional URL that receives a POST for each incoming SMS | |
| idempotency_key | No | Any unique string (e.g. a UUID). Repeating a call with the same key returns the first result instead of acting twice. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| days | Yes | ||
| number | Yes | ||
| planId | Yes | ||
| status | Yes | ||
| priceEur | Yes |