make_outbound_call
Initiate phone calls using an ElevenLabs AI agent to connect with phone numbers. Automatically selects the appropriate telephony provider (Twilio or SIP trunk) based on configuration.
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:968-995 (handler)The handler function that implements the logic for making an outbound call using ElevenLabs API. Detects the provider type and invokes the appropriate outbound_call method.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:954-967 (registration)Registers the 'make_outbound_call' tool using the @mcp.tool decorator, including detailed description, arguments, and usage warnings.@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:945-951 (helper)Supporting helper function that retrieves phone number details by ID from the ElevenLabs client, 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.")