fix: add MCP server outbound phone number validation and guidance#37
Open
vapi-tasker[bot] wants to merge 1 commit intomainfrom
Open
fix: add MCP server outbound phone number validation and guidance#37vapi-tasker[bot] wants to merge 1 commit intomainfrom
vapi-tasker[bot] wants to merge 1 commit intomainfrom
Conversation
Prevent cryptic API errors when MCP users attempt outbound calls with Vapi-provisioned (inbound-only) phone numbers by adding pre-validation and clear tool descriptions. Changes: - Add transformPhoneNumberOutput to expose provider field, letting users identify which numbers support outbound calling - Update create_call tool description to warn that outbound requires Twilio or Vonage imported numbers - Update CallInputSchema phoneNumberId description to document the Vapi inbound-only restriction and reference list_phone_numbers tool - Add validatePhoneNumberForOutbound pre-validation in transformCallInput that throws OutboundCallValidationError with actionable guidance Resolves: VAPICS-696 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Prevents cryptic API errors when MCP users attempt outbound calls with Vapi-provisioned (inbound-only) phone numbers by adding pre-validation and clear tool/schema descriptions.
Problem: When an MCP-connected AI agent tries to create an outbound call using a Vapi-provisioned phone number, the API returns a cryptic error:
call.start.error-get-transport — "Vapi Numbers Can't Dial Outbound Yet". The MCP tools provide no guidance about which phone numbers support outbound calling.Solution: Four targeted fixes across three new files in
mcp-server/src/:transformers/index.ts—transformPhoneNumberOutput: Exposes theproviderfield so MCP users can identify outbound-capable numbers (twilio, vonage, telnyx, byo-phone-number) vs inbound-only (vapi)tools/call.ts—createCallTool: Updated tool description warns that outbound calls require Twilio or Vonage imported numbers and referenceslist_phone_numberstoolschemas/index.ts—CallInputSchema.phoneNumberId: Description documents the Vapi inbound-only restriction with actionable guidancetransformers/index.ts—validatePhoneNumberForOutbound+transformCallInput: Pre-validates phone number provider before API call, throwsOutboundCallValidationErrorwith clear, actionable error message for Vapi numbersTest Plan
OutboundCallValidationErrortransformPhoneNumberOutputstrips sensitive API fields while exposingprovidertransformCallInputskips validation when nofetchPhoneNumberis providedLinear Issue
VAPICS-696