Skip to main content
Glama

retell_import_phone_number

Import an existing phone number from external providers via SIP to connect it with AI agents for handling inbound and outbound calls.

Instructions

Import an existing phone number from an external provider via SIP.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
phone_numberYesThe phone number to import in E.164 format
termination_uriYesSIP termination URI for the phone number
inbound_agent_idNoOptional: Agent ID for inbound calls
outbound_agent_idNoOptional: Agent ID for outbound calls

Implementation Reference

  • The handler case in the executeTool switch statement that invokes the Retell API to import a phone number via POST to /import-phone-number with the tool arguments.
    case "retell_import_phone_number":
      return retellRequest("/import-phone-number", "POST", args);
  • Tool schema definition including name, description, and input validation schema in the tools array.
    {
      name: "retell_import_phone_number",
      description: "Import an existing phone number from an external provider via SIP.",
      inputSchema: {
        type: "object",
        properties: {
          phone_number: {
            type: "string",
            description: "The phone number to import in E.164 format"
          },
          termination_uri: {
            type: "string",
            description: "SIP termination URI for the phone number"
          },
          inbound_agent_id: {
            type: "string",
            description: "Optional: Agent ID for inbound calls"
          },
          outbound_agent_id: {
            type: "string",
            description: "Optional: Agent ID for outbound calls"
          }
        },
        required: ["phone_number", "termination_uri"]
      }
    },
  • src/index.ts:1283-1285 (registration)
    Registers the handler for listing all tools, returning the tools array that includes retell_import_phone_number.
    server.setRequestHandler(ListToolsRequestSchema, async () => {
      return { tools };
    });
  • src/index.ts:1287-1291 (registration)
    Registers the generic CallToolRequestSchema handler that dispatches to executeTool based on tool name, enabling execution of retell_import_phone_number.
    // Register tool execution handler
    server.setRequestHandler(CallToolRequestSchema, async (request) => {
      const { name, arguments: args } = request.params;
    
      try {
  • Generic helper function used by all Retell tool handlers to make authenticated API requests to the Retell service.
    async function retellRequest(
      endpoint: string,
      method: string = "GET",
      body?: Record<string, unknown>
    ): Promise<unknown> {
      const apiKey = getApiKey();
    
      const headers: Record<string, string> = {
        "Authorization": `Bearer ${apiKey}`,
        "Content-Type": "application/json",
      };
    
      const options: RequestInit = {
        method,
        headers,
      };
    
      if (body && method !== "GET") {
        options.body = JSON.stringify(body);
      }
    
      const response = await fetch(`${RETELL_API_BASE}${endpoint}`, options);
    
      if (!response.ok) {
        const errorText = await response.text();
        throw new Error(`Retell API error (${response.status}): ${errorText}`);
      }
    
      // Handle 204 No Content
      if (response.status === 204) {
        return { success: true };
      }
    
      return response.json();
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions 'import' and 'via SIP,' implying a mutation operation, but fails to describe critical behaviors like required permissions, whether this action is reversible, potential costs or rate limits, or what happens on success/failure. This leaves significant gaps for an agent to understand the tool's impact.

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 any wasted words. It is front-loaded with the core action and resource, making it easy to parse quickly.

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?

Given the complexity of importing a phone number (a mutation operation with no annotations and no output schema), the description is incomplete. It lacks details on behavioral traits (e.g., side effects, error handling), output expectations, and usage context. For a tool with 4 parameters and potential integration implications, this minimal description falls short of providing adequate guidance.

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 parameters (phone_number, termination_uri, inbound_agent_id, outbound_agent_id) with clear descriptions. The description adds no additional meaning beyond what the schema provides, such as explaining the relationship between parameters or usage examples. The baseline of 3 is appropriate when the schema does the heavy lifting.

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 ('import') and resource ('existing phone number from an external provider via SIP'), making the purpose understandable. However, it doesn't explicitly differentiate from sibling tools like 'retell_create_phone_number' (which likely creates new numbers rather than importing existing ones), so it misses full sibling distinction.

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 (e.g., 'retell_create_phone_number' for new numbers or other import methods). It lacks context about prerequisites, such as needing an external provider setup, or exclusions for when not to use it.

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