provision_number
Provision a phone number for receiving SMS, sending messages, or making voice calls. Specify a phone number or area code to get an E.164 number for 2FA or outbound calls. Save the returned number for later use.
Instructions
Provision a phone number the agent can use — for receiving SMS (e.g. 2FA), sending SMS, or placing/receiving voice calls.
Use this BEFORE signing up for a service that asks for a phone number, or
before making outbound calls. If phone_number is given, provisions that
specific number; otherwise auto-searches by area_code.
Returns a dict with id, phone_number (E.164 format — pass this to forms),
provider, and status. Save the returned phone_number — you need it to
later release_number or wait_for_sms.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| area_code | No | ||
| country_code | No | US | |
| phone_number | No |
Implementation Reference
- agentline_mcp/server.py:64-89 (handler)The main handler function for the 'provision_number' MCP tool. It is decorated with @mcp.tool() to register it as an MCP tool, accepts optional area_code, country_code (default "US"), and phone_number parameters, delegates to the Agentline SDK client, and returns the result as a dict.
@mcp.tool() def provision_number( area_code: str | None = None, country_code: str = "US", phone_number: str | None = None, ) -> dict: """Provision a phone number the agent can use — for receiving SMS (e.g. 2FA), sending SMS, or placing/receiving voice calls. Use this BEFORE signing up for a service that asks for a phone number, or before making outbound calls. If `phone_number` is given, provisions that specific number; otherwise auto-searches by `area_code`. Returns a dict with `id`, `phone_number` (E.164 format — pass this to forms), `provider`, and `status`. Save the returned `phone_number` — you need it to later `release_number` or `wait_for_sms`. """ try: result = _client_or_init().provision_number( phone_number=phone_number, area_code=area_code, country_code=country_code, ) return asdict(result) except AgentlineError as e: return {"error": str(e), "status_code": e.status_code} - agentline_mcp/server.py:64-65 (registration)The tool is registered with FastMCP via the @mcp.tool() decorator on line 64. The mcp instance is created at line 47 (mcp = FastMCP('agentline')).
@mcp.tool() def provision_number( - agentline_mcp/server.py:65-69 (schema)Input parameters: area_code (optional string), country_code (default 'US'), phone_number (optional string). Return type is dict.
def provision_number( area_code: str | None = None, country_code: str = "US", phone_number: str | None = None, ) -> dict: