Skip to main content
Glama
VapiAI

Vapi MCP Server

Official
by VapiAI

get_call

Retrieve details for a specific call by providing its unique ID to access call information and status.

Instructions

Gets details of a specific call

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
callIdYesID of the call to get

Implementation Reference

  • Core handler logic: fetches call details by ID using Vapi client and transforms output.
    createToolHandler(async (data) => { const call = await vapiClient.calls.get(data.callId); return transformCallOutput(call); })
  • Zod schema defining input for get_call: requires 'callId' as string.
    export const GetCallInputSchema = z.object({ callId: z.string().describe('ID of the call to get'), });
  • Registers the 'get_call' tool with MCP server, including name, description, input schema, and handler.
    server.tool( 'get_call', 'Gets details of a specific call', GetCallInputSchema.shape, createToolHandler(async (data) => { const call = await vapiClient.calls.get(data.callId); return transformCallOutput(call); }) );
  • Helper that wraps raw handler functions with try-catch error handling and standardizes response format.
    export function createToolHandler<T>( handler: (params: T) => Promise<any> ): (params: T) => Promise<ToolResponse> { return async (params: T) => { try { const result = await handler(params); return createSuccessResponse(result); } catch (error) { return createErrorResponse(error); } }; }
  • Transformer utility that converts Vapi Call object to the standardized 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