Skip to main content
Glama
VapiAI

Vapi MCP Server

Official
by VapiAI

create_call

Initiate outbound calls using AI assistants, schedule calls for specific times, and customize assistant behavior with dynamic variables.

Instructions

Creates a outbound call

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
assistantIdNoID of the assistant to use for the call
phoneNumberIdNoID of the phone number to use for the call
customerNoCustomer information
scheduledAtNoISO datetime string for when the call should be scheduled (e.g. "2025-03-25T22:39:27.771Z")
assistantOverridesNoOverrides for the assistant configuration

Implementation Reference

  • Registers the 'create_call' MCP tool on the server, specifying name, description, input schema (CallInputSchema.shape), and the handler function wrapped by createToolHandler.
    server.tool( 'create_call', 'Creates a outbound call', CallInputSchema.shape, createToolHandler(async (data) => { const createCallDto = transformCallInput(data); const call = await vapiClient.calls.create(createCallDto); return transformCallOutput(call as unknown as Vapi.Call); }) );
  • The core execution logic for the 'create_call' tool: transforms input data using transformCallInput, creates the call using vapiClient.calls.create, and transforms the output using transformCallOutput.
    createToolHandler(async (data) => { const createCallDto = transformCallInput(data); const call = await vapiClient.calls.create(createCallDto); return transformCallOutput(call as unknown as Vapi.Call); })
  • Zod schema defining the input parameters for the 'create_call' tool, including optional fields for assistantId, phoneNumberId, customer number, scheduledAt, and assistantOverrides.
    export const CallInputSchema = z.object({ assistantId: z .string() .optional() .describe('ID of the assistant to use for the call'), phoneNumberId: z .string() .optional() .describe('ID of the phone number to use for the call'), customer: z .object({ number: z.string().describe('Customer phone number'), }) .optional() .describe('Customer information'), scheduledAt: z .string() .optional() .describe( 'ISO datetime string for when the call should be scheduled (e.g. "2025-03-25T22:39:27.771Z")' ), assistantOverrides: z .object({ variableValues: z .record(z.string(), z.any()) .optional() .describe( 'Key-value pairs for dynamic variables to use in the assistant\'s prompts (e.g. {"name": "Joe", "age": "24"})' ), }) .optional() .describe('Overrides for the assistant configuration'), });
  • Helper function that transforms the tool input (z.infer<CallInputSchema>) into Vapi.CreateCallDto format for the Vapi API call.
    export function transformCallInput( input: z.infer<typeof CallInputSchema> ): Vapi.CreateCallDto { return { ...(input.assistantId ? { assistantId: input.assistantId } : {}), ...(input.phoneNumberId ? { phoneNumberId: input.phoneNumberId } : {}), ...(input.customer ? { customer: { number: input.customer.number, }, } : {}), ...(input.scheduledAt ? { schedulePlan: { earliestAt: input.scheduledAt, }, } : {}), ...(input.assistantOverrides ? { assistantOverrides: input.assistantOverrides, } : {}), }; }
  • Helper function that transforms the Vapi.Call response into the output format matching CallOutputSchema.
    export function transformCallOutput( call: Vapi.Call ): z.infer<typeof CallOutputSchema> { return { id: call.id, createdAt: call.createdAt, updatedAt: call.updatedAt, status: call.status || '', endedReason: call.endedReason, assistantId: call.assistantId, phoneNumberId: call.phoneNumberId, customer: call.customer ? { number: call.customer.number || '', } : undefined, scheduledAt: call.schedulePlan?.earliestAt, }; }

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