make_outbound_call
Initiate phone calls using ElevenLabs AI agents by specifying agent, phone number, and recipient details for automated voice communication.
Instructions
Make an outbound call using an ElevenLabs agent. Automatically detects provider type (Twilio or SIP trunk) and uses the appropriate API.
⚠️ COST WARNING: This tool makes an API call to ElevenLabs which may incur costs. Only use when explicitly requested by the user.
Args:
agent_id: The ID of the agent that will handle the call
agent_phone_number_id: The ID of the phone number to use for the call
to_number: The phone number to call (E.164 format: +1xxxxxxxxxx)
Returns:
TextContent containing information about the call
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| agent_id | Yes | ||
| agent_phone_number_id | Yes | ||
| to_number | Yes |
Implementation Reference
- elevenlabs_mcp/server.py:1027-1054 (handler)The main handler function for the 'make_outbound_call' tool. It retrieves phone number details to detect the provider (Twilio or SIP trunk) and initiates the outbound call using the appropriate ElevenLabs API endpoint.def make_outbound_call( agent_id: str, agent_phone_number_id: str, to_number: str, ) -> TextContent: # Get phone number details to determine provider type phone_number = _get_phone_number_by_id(agent_phone_number_id) if phone_number.provider.lower() == "twilio": response = client.conversational_ai.twilio.outbound_call( agent_id=agent_id, agent_phone_number_id=agent_phone_number_id, to_number=to_number, ) provider_info = "Twilio" elif phone_number.provider.lower() == "sip_trunk": response = client.conversational_ai.sip_trunk.outbound_call( agent_id=agent_id, agent_phone_number_id=agent_phone_number_id, to_number=to_number, ) provider_info = "SIP trunk" else: make_error(f"Unsupported provider type: {phone_number.provider}") return TextContent( type="text", text=f"Outbound call initiated via {provider_info}: {response}." )
- elevenlabs_mcp/server.py:1013-1026 (registration)Registers the 'make_outbound_call' tool with the FastMCP server using the @mcp.tool decorator, including a detailed description of parameters and usage.@mcp.tool( description="""Make an outbound call using an ElevenLabs agent. Automatically detects provider type (Twilio or SIP trunk) and uses the appropriate API. ⚠️ COST WARNING: This tool makes an API call to ElevenLabs which may incur costs. Only use when explicitly requested by the user. Args: agent_id: The ID of the agent that will handle the call agent_phone_number_id: The ID of the phone number to use for the call to_number: The phone number to call (E.164 format: +1xxxxxxxxxx) Returns: TextContent containing information about the call """ )
- elevenlabs_mcp/server.py:1004-1011 (helper)Private helper function that fetches all phone numbers and returns the one matching the given ID, used by the handler to determine the provider type.def _get_phone_number_by_id(phone_number_id: str): """Helper function to get phone number details by ID.""" phone_numbers = client.conversational_ai.phone_numbers.list() for phone in phone_numbers: if phone.phone_number_id == phone_number_id: return phone make_error(f"Phone number with ID {phone_number_id} not found.")