Skip to main content
Glama

retell_create_phone_number

Register a phone number for Retell AI agents to handle inbound and outbound calls, specifying area code and optional agent assignments.

Instructions

Register/purchase a new phone number for use with Retell AI agents.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
area_codeYesThe area code for the phone number (e.g., '415' for San Francisco)
inbound_agent_idNoOptional: Agent ID to handle inbound calls to this number
outbound_agent_idNoOptional: Agent ID to use for outbound calls from this number
nicknameNoOptional: A friendly name for the phone number

Implementation Reference

  • The handler logic for the 'retell_create_phone_number' tool, which makes a POST request to the Retell API endpoint '/create-phone-number' using the generic retellRequest helper function.
    case "retell_create_phone_number":
      return retellRequest("/create-phone-number", "POST", args);
  • The tool schema definition, including input validation schema, description, and registration in the tools list used by the MCP server.
    {
      name: "retell_create_phone_number",
      description: "Register/purchase a new phone number for use with Retell AI agents.",
      inputSchema: {
        type: "object",
        properties: {
          area_code: {
            type: "string",
            description: "The area code for the phone number (e.g., '415' for San Francisco)"
          },
          inbound_agent_id: {
            type: "string",
            description: "Optional: Agent ID to handle inbound calls to this number"
          },
          outbound_agent_id: {
            type: "string",
            description: "Optional: Agent ID to use for outbound calls from this number"
          },
          nickname: {
            type: "string",
            description: "Optional: A friendly name for the phone number"
          }
        },
        required: ["area_code"]
      }
    },
  • src/index.ts:1283-1285 (registration)
    The registration of the tool list handler that exposes all tools, including 'retell_create_phone_number', to the MCP protocol.
    server.setRequestHandler(ListToolsRequestSchema, async () => {
      return { tools };
    });
  • The executeTool dispatcher function that handles tool execution based on name, containing the specific case for this tool.
    async function executeTool(name: string, args: Record<string, unknown>): Promise<unknown> {
      switch (name) {
        // Call Management
        case "retell_create_phone_call":
          return retellRequest("/v2/create-phone-call", "POST", args);
        case "retell_create_web_call":
          return retellRequest("/v2/create-web-call", "POST", args);
        case "retell_get_call":
          return retellRequest(`/v2/get-call/${args.call_id}`, "GET");
        case "retell_list_calls":
          return retellRequest("/v2/list-calls", "POST", args);
        case "retell_update_call": {
          const { call_id, ...updateData } = args;
          return retellRequest(`/v2/update-call/${call_id}`, "PATCH", updateData as Record<string, unknown>);
        }
        case "retell_delete_call":
          return retellRequest(`/v2/delete-call/${args.call_id}`, "DELETE");
    
        // Chat Management
        case "retell_create_chat":
          return retellRequest("/create-chat", "POST", args);
        case "retell_create_sms_chat":
          return retellRequest("/create-sms-chat", "POST", args);
        case "retell_get_chat":
          return retellRequest(`/get-chat/${args.chat_id}`, "GET");
        case "retell_create_chat_completion":
          return retellRequest("/create-chat-completion", "POST", args);
        case "retell_list_chats":
          return retellRequest("/list-chat", "GET");
        case "retell_end_chat":
          return retellRequest("/end-chat", "PATCH", args);
    
        // Phone Number Management
        case "retell_create_phone_number":
          return retellRequest("/create-phone-number", "POST", args);
        case "retell_get_phone_number":
          return retellRequest(`/get-phone-number/${encodeURIComponent(args.phone_number as string)}`, "GET");
        case "retell_list_phone_numbers":
          return retellRequest("/list-phone-numbers", "GET");
        case "retell_update_phone_number": {
          const { phone_number, ...phoneUpdateData } = args;
          return retellRequest(`/update-phone-number/${encodeURIComponent(phone_number as string)}`, "PATCH", phoneUpdateData as Record<string, unknown>);
        }
        case "retell_delete_phone_number":
          return retellRequest(`/delete-phone-number/${encodeURIComponent(args.phone_number as string)}`, "DELETE");
        case "retell_import_phone_number":
          return retellRequest("/import-phone-number", "POST", args);
    
        // Voice Agent Management
        case "retell_create_agent":
          return retellRequest("/create-agent", "POST", args);
        case "retell_get_agent":
          return retellRequest(`/get-agent/${args.agent_id}`, "GET");
        case "retell_list_agents":
          return retellRequest("/list-agents", "GET");
        case "retell_update_agent": {
          const { agent_id, ...agentUpdateData } = args;
          return retellRequest(`/update-agent/${agent_id}`, "PATCH", agentUpdateData as Record<string, unknown>);
        }
        case "retell_delete_agent":
          return retellRequest(`/delete-agent/${args.agent_id}`, "DELETE");
        case "retell_publish_agent":
          return retellRequest(`/publish-agent/${args.agent_id}`, "POST");
        case "retell_get_agent_versions":
          return retellRequest(`/get-agent-versions/${args.agent_id}`, "GET");
    
        // Chat Agent Management
        case "retell_create_chat_agent":
          return retellRequest("/create-chat-agent", "POST", args);
        case "retell_get_chat_agent":
          return retellRequest(`/get-chat-agent/${args.agent_id}`, "GET");
        case "retell_list_chat_agents":
          return retellRequest("/list-chat-agents", "GET");
        case "retell_update_chat_agent": {
          const { agent_id: chatAgentId, ...chatAgentUpdateData } = args;
          return retellRequest(`/update-chat-agent/${chatAgentId}`, "PATCH", chatAgentUpdateData as Record<string, unknown>);
        }
        case "retell_delete_chat_agent":
          return retellRequest(`/delete-chat-agent/${args.agent_id}`, "DELETE");
    
        // Retell LLM Management
        case "retell_create_llm":
          return retellRequest("/create-retell-llm", "POST", args);
        case "retell_get_llm":
          return retellRequest(`/get-retell-llm/${args.llm_id}`, "GET");
        case "retell_list_llms":
          return retellRequest("/list-retell-llms", "GET");
        case "retell_update_llm": {
          const { llm_id, ...llmUpdateData } = args;
          return retellRequest(`/update-retell-llm/${llm_id}`, "PATCH", llmUpdateData as Record<string, unknown>);
        }
        case "retell_delete_llm":
          return retellRequest(`/delete-retell-llm/${args.llm_id}`, "DELETE");
    
        // Conversation Flow Management
        case "retell_create_conversation_flow":
          return retellRequest("/create-conversation-flow", "POST", args);
        case "retell_get_conversation_flow":
          return retellRequest(`/get-conversation-flow/${args.conversation_flow_id}`, "GET");
        case "retell_list_conversation_flows":
          return retellRequest("/list-conversation-flows", "GET");
        case "retell_update_conversation_flow": {
          const { conversation_flow_id, ...flowUpdateData } = args;
          return retellRequest(`/update-conversation-flow/${conversation_flow_id}`, "PATCH", flowUpdateData as Record<string, unknown>);
        }
        case "retell_delete_conversation_flow":
          return retellRequest(`/delete-conversation-flow/${args.conversation_flow_id}`, "DELETE");
    
        // Knowledge Base Management
        case "retell_create_knowledge_base":
          return retellRequest("/create-knowledge-base", "POST", args);
        case "retell_get_knowledge_base":
          return retellRequest(`/get-knowledge-base/${args.knowledge_base_id}`, "GET");
        case "retell_list_knowledge_bases":
          return retellRequest("/list-knowledge-bases", "GET");
        case "retell_delete_knowledge_base":
          return retellRequest(`/delete-knowledge-base/${args.knowledge_base_id}`, "DELETE");
        case "retell_add_knowledge_base_sources": {
          const { knowledge_base_id, sources } = args;
          return retellRequest(`/add-knowledge-base-sources/${knowledge_base_id}`, "POST", { sources });
        }
        case "retell_delete_knowledge_base_source": {
          const { knowledge_base_id: kbId, source_id } = args;
          return retellRequest(`/delete-knowledge-base-source/${kbId}/${source_id}`, "DELETE");
        }
    
        // Voice Management
        case "retell_get_voice":
          return retellRequest(`/get-voice/${args.voice_id}`, "GET");
        case "retell_list_voices":
          return retellRequest("/list-voices", "GET");
    
        // Batch Operations
        case "retell_create_batch_call":
          return retellRequest("/create-batch-call", "POST", args);
        case "retell_create_batch_test":
          return retellRequest("/create-batch-test", "POST", args);
    
        // Account & Telephony
        case "retell_get_concurrency":
          return retellRequest("/get-concurrency", "GET");
        case "retell_register_phone_call":
          return retellRequest("/register-phone-call", "POST", args);
    
        default:
          throw new Error(`Unknown tool: ${name}`);
      }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. It mentions 'Register/purchase' which implies a write operation, but doesn't address critical aspects like whether this incurs costs, requires specific permissions, has rate limits, or what happens on failure. The description is insufficient for a mutation tool with zero annotation coverage.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's purpose without unnecessary words. It's appropriately sized and front-loaded, with every word earning its place in conveying the essential function.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a mutation tool ('Register/purchase') with no annotations and no output schema, the description is incomplete. It doesn't address behavioral aspects like costs, permissions, or response format. While the schema covers parameters well, the overall context for using this tool safely and effectively is lacking.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all four parameters thoroughly. The description doesn't add any parameter-specific information beyond what's in the schema. According to scoring rules, when schema coverage is high (>80%), the baseline is 3 even with no param info in the description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Register/purchase') and resource ('new phone number for use with Retell AI agents'), providing a specific purpose. However, it doesn't differentiate from sibling tools like 'retell_import_phone_number' or 'retell_update_phone_number', which would require explicit comparison to achieve a score of 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'retell_import_phone_number' or 'retell_update_phone_number'. It lacks context about prerequisites, costs, or limitations, offering only a basic functional statement without usage boundaries.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/itsanamune/retellsimp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server