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
| Name | Required | Description | Default |
|---|---|---|---|
| callId | Yes | ID of the call to get |
Implementation Reference
- src/tools/call.ts:40-43 (handler)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); })
- src/schemas/index.ts:303-305 (schema)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'), });
- src/tools/call.ts:36-44 (registration)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); }) );
- src/tools/utils.ts:30-41 (helper)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); } }; }
- src/transformers/index.ts:211-229 (helper)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, }; }