Skip to main content
Glama
VapiAI

Vapi MCP Server

Official
by VapiAI

list_phone_numbers

Retrieve all Vapi phone numbers linked to your account. Use this tool to view available numbers for call management and API integration.

Instructions

Lists all Vapi phone numbers

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The tool registration and handler for 'list_phone_numbers'. Calls vapiClient.phoneNumbers.list({ limit: 10 }) and transforms the results using transformPhoneNumberOutput.
    server.tool(
      'list_phone_numbers',
      'Lists all Vapi phone numbers',
      {},
      createToolHandler(async () => {
        const phoneNumbers = await vapiClient.phoneNumbers.list({ limit: 10 });
        return phoneNumbers.map(transformPhoneNumberOutput);
      })
  • Registration entry point - calls registerPhoneNumberTools() which registers the 'list_phone_numbers' tool on the MCP server.
    export const registerAllTools = (server: McpServer, vapiClient: VapiClient) => {
      registerAssistantTools(server, vapiClient);
      registerCallTools(server, vapiClient);
      registerPhoneNumberTools(server, vapiClient);
      registerToolTools(server, vapiClient);
    };
  • The transformPhoneNumberOutput helper used by the handler to map phone number data to the PhoneNumberOutputSchema format.
    export function transformPhoneNumberOutput(
      phoneNumber: any
    ): z.infer<typeof PhoneNumberOutputSchema> {
      return {
        id: phoneNumber.id,
        name: phoneNumber.name,
        createdAt: phoneNumber.createdAt,
        updatedAt: phoneNumber.updatedAt,
        phoneNumber: phoneNumber.number,
        status: phoneNumber.status,
      };
    }
  • PhoneNumberOutputSchema - defines the output shape of phone number data (id, name, createdAt, updatedAt, phoneNumber, status). The list_phone_numbers tool returns data in this shape.
    export const PhoneNumberOutputSchema = BaseResponseSchema.extend({
      name: z.string().optional(),
      phoneNumber: z.string(),
      status: z.string(),
      capabilities: z
        .object({
          sms: z.boolean().optional(),
          voice: z.boolean().optional(),
        })
        .optional(),
    });
  • The createToolHandler wrapper used by the handler to provide auth checking, error handling, and response formatting.
    export function createToolHandler<T>(
      handler: (params: T) => Promise<any>
    ): (params: T) => Promise<ToolResponse> {
      return async (params: T) => {
        // Check auth first
        if (!hasValidToken()) {
          // Start auth if not already in progress
          if (!isAuthInProgress()) {
            try {
              await startAuthFlow();
            } catch (error) {
              // Ignore - we'll show the auth URL below
            }
          }
          const url = getAuthUrl();
          if (url) {
            return createAuthRequiredResponse(url);
          }
          return createErrorResponse('Authentication required. Please use vapi_login tool first.');
        }
    
        try {
          const result = await handler(params);
          return createSuccessResponse(result);
        } catch (error) {
          return createErrorResponse(error);
        }
      };
    }
Behavior2/5

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

With no annotations, the description carries full burden but only states the basic function. It does not disclose behavioral traits such as read-only nature, pagination, rate limits, or any filters. The description is too sparse to inform about potential side effects or constraints.

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 sentence with no redundant words. It is maximally concise and focused.

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

Completeness3/5

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

Given the tool has no parameters and no output schema, the description is minimally adequate. However, it lacks information on pagination, response format, or whether all phone numbers are truly listed without limits. It could be more complete.

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

Parameters4/5

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

There are zero parameters in the input schema, so the description does not need to explain param semantics. Baseline for 0 params is 4, and no additional information is required.

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

Purpose5/5

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

The description uses a specific verb 'Lists' and clearly identifies the resource 'all Vapi phone numbers'. It distinguishes from sibling tools like list_assistants, list_calls, list_tools, and get_phone_number.

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?

No guidance is provided on when to use this tool versus alternatives, nor any prerequisites or when not to use it. The intended usage context is implicit but not explicit.

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/VapiAI/mcp-server'

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